my command line tests seem to work ok...

however, when i create a simple php test using the exec(...) it doesn't seem
to work. in fact i can't tell if the exec ever really gets executed!! i have
errors/warnings turned on within the php environment. as far as i can tell,
i have nothing within the php.ini file disabled/enabled which would cause
issues.

but i fail to see the child process in the process table.

any ideas/possible places i should look for the cause of this behavior..???

thanks

-bruce


-----Original Message-----
From: Michael Sims [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 21, 2004 12:43 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] exec/system question..


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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to