Justin Patrin wrote: > On Wed, 21 Jul 2004 13:55:37 -0500, Michael Sims > <[EMAIL PROTECTED]> wrote: >> Sorry to followup to my own post, but I just did some quick testing >> and apparently none of the above (nohup, setsid) is really >> necessary. As long as the output of the command is redirected >> somewhere and the "&" is used to start it in the background it will >> continue to run even if the process that launched it exits or is >> killed. I tested this with the following (named 'test.php'): [...] > Did you try it from the web?
No, I didn't actually try it via an apache request without the nohup. I should do that... > Just to be devil's advocate and be sure > that, say, clicking Stop doesn't stop the background process. Also, > does *killing* the original script kill the child? No. I tried killing the script via kill and then kill -9, allowing the "parent" script to exit normally BEFORE the child (by having the child sleep() longer than the parent), and disconnnecting from the controlling tty before the process finished. In all of the above tests the child process lived on and exited normally. It seems to me that the PHP interpreter intentionally ignores hangup signals when it detects that it's output is not being sent to a terminal. Of course, this is getting a bit beyond my current understanding of processes, signals, etc. so I could be completely full of it. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php