Escript+Supervisor+Genserver

You can do this, or you can ‘wait’ for the supervisor to die naturally (trap exit and receive its normal stop signal probably, or a monitor if you like that), or just stop the system from within the actual application code via :init.stop(0).

1 Like

Or if your script is one that should truly run forever (where “forever” means “until SIGINT”), you could Process.sleep(:infinity) at the end of main…

1 Like