[erlang-questions] Issues with stdin on ports
Wed Jul 31 20:46:13 CEST 2013
Your solution is less obtrusive but less stable. What will happen with
your system if you leave some processes because your code failed to do
os:cmd? Or what will happen if your erlang is killed?
On Wed, Jul 31, 2013 at 10:36 PM, Per Hedeland <per@REDACTED> wrote:
> Max Lapshin <max.lapshin@REDACTED> wrote:
>>I have a ffmpeg-like program that is launched by erlang server and it is
>>very busy doing its job.
>>Sometimes erlang server can decide to kill it.
>>I have implemented it so: there is a second thread that is reading stdin.
>>If stdin is closed, this thread immediately calls _exit()
>>Such approach works good but it requires modification of program.
> Just in case you (understandably) can't be bothered to read my exchange
> with ROK, as of R15B02 you can get hold of the Unix pid of the external
> process with erlang:port_info(Port, os_pid), and thus be able to kill it
> (using os:cmd/1) without modification of the program. I believe David
> Welton posted with a similar issue, i.e. "You can't kill them" - not
> true anymore.
More information about the erlang-questions