[erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes?
freza@REDACTED
freza@REDACTED
Thu Sep 27 20:18:44 CEST 2012
On Thu, Sep 27, 2012 at 11:29:03AM +0200, Jesper Louis Andersen wrote:
> I remember this was something I had going. Let me dig code:
>
> ----
> #!/bin/sh
>
> (cat && kill 0) | opentracker $*
> ----
>
> So the trick is that the ? && kill 0 part sends a kill signal to all processes in the current process group. This lets you stop another process since cat(1) understands what happens when stdin is closed and handles it accordingly.
>
> I've only used it in tests though so it may need work for real programs
Haven't been following this thread closely, but it seems erlexec wasn't
mentioned yet:
http://code.google.com/p/erlexec/
BR,
-- Jachym
More information about the erlang-questions
mailing list