ityonemo
Getting zombies with erlexec
Hi! I’m still getting zombie processes with erlexec and nothing that I do seems to be able to resolve this. Firstly, i’m on linux. Secondly, i can’t use muontrap, since I need to stream input and output into the other process.
Here’s the code:
#... Genserver Headers
def init(_) do
:erlexec.run_link("priv/forever.sh", [:stderr, :stdout, :kill_group])
#...
forever.sh
#!/bin/bash
while true; do
sleep 1
end
Control-c/a definitely creates a zombie (I think the GenServer doesn’t even get the stop message), and even System.stop(0) creates a zombie.
I’m free to put anything in the top of the forever script, so if I can use that to, maybe set the process group or a job, I can definitely do that, but I’m not familiar enough with linux to know if that makes sense. thanks
Thanks in advance.
Most Liked
akash-akya
There is no clean way to do it without using middleware if you are consuming stdin. You need another OS process which act like monitor and do the cleanup. mountrap & ExCmd are such middlewere, but mountrap does not support communicating with the external process and ex_cmd does.
Also If you are streaming a lot of data in/out of beam then it can lead to memory issue. ex_cmd also solves that. See memory issue mentioned here
lud
Not sure if rambo could help there as I think it does the same thing as muontrap, but maybe worth checking.
LostKobrakai
You can also take look at ex_cmd.







