[erlang-questions] port_close/1 problem

Serge Aleynikov <>
Wed Oct 31 06:48:54 CET 2007


Hi,

I am having a problem shutting down a port program started using 
open_port({spawn, Exe}, [binary, {packet, 2}, nouse_stdio, exit_status]).

When the owner Pid dies or explicitly calls port_close(Port) the linked 
OS process remains running.  It is a 3rd party binary interpreter.  Is 
it because it might be intercepting SIGINT or some other signals?

Is there a way to figure out it's OS pid and shut it down or is there a 
"proper" way of killing it from within the emulator?  (doing 
os:cmd("pkill ExeName") is not an option as there might be many 
instances of ExeName running.  I looked through port_info/1 options but 
don't see a way of determining port's OS pid.

Serge



More information about the erlang-questions mailing list