[erlang-questions] closing a port doesn't kill the connected process?

Robert Virding <>
Wed Mar 24 05:47:54 CET 2010


When the port is closed the spawned port should get an end-of-file on
its stdin. This is the "standard" way for the process to detect when
the port has been closed: an end-of-file on stdin.

Robert

On 22 March 2010 20:00, Jacob Vorreuter <> wrote:
> I'm starting a redis server instance by opening an Erlang port.  When the Erlang process exits or I explicitly close the port the os process is not killed.  Is there a way to accomplish that?
>
> 1> Port = erlang:open_port({spawn, "redis-server"}, [binary, exit_status]).
> #Port<0.429>
> 2> erlang:port_close(Port).
> true
>
> $ ps -ax | grep redis-server
> 31374 ??         0:00.02 redis-server
>
> Thanks,
>
> Jake
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>


More information about the erlang-questions mailing list