[erlang-questions] open_port + spawn and closing the spawned application when port closes

Vans S vans_163@REDACTED
Thu Dec 13 15:23:13 CET 2018


I recall there was a way to do this by basho but wondering if there are new alternatives recently.

Basically the example is a simple one, open_port({spawn, "curl -L "http://releases.ubuntu.com/18.04.1.0/ubuntu-18.04.1.0-live-server-amd64.iso?" --progress-bar -o /dev/null"}) now kill the process, close the port, or kill the emulator.  The curl process keeps running.  I believe it was when the port closes, stdin/stdout closes for the process, and the work around was to wrap the process in a bash script that would detect stdin/out closed, and terminate the process it wrapped.

Any thoughts on this, or perhaps help finding that bash script again?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181213/01173ca4/attachment.htm>


More information about the erlang-questions mailing list