I'm planning to control some programs (like a media player and a shell) via a webapp,
since the webpage die everytime the user visits it, I decided that the webapp will opens the program with setsid
and then the webapp will communicate with it through pipes.
Note: I can't use nohup
becouse something like nohup bash -i <fifoin >fifoout 2>&1 &
automatically stops.
With setsid
everything works perfectly, but I cannot kill the process since I don't know the ID of the forked process! ..So, how can I retrive the ID of the setsid
ed process?
I tried something like
setsid bash -i <fifoin >fifoout 2>&1
kill $!
kill $$
As result, both kill
don't work, I wont search the ID with ps -e
becouse I can't kill all the running bash -i
shell !