|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-07-12 01:00 UTC] carb at videotron dot ca
Description:
------------
When forking off a process from PHP with the statement exec("command > /dev/null &"), the process will get killed when the httpd is closed.
Note: This occurs even though ps is telling me that the parent process id is init (parent process id 1).
Reproduce code:
---------------
<?PHP
session_write_close();
//Simple example to reproduce problematic forking.
exec("ping localhost > /dev/null &");
?>
Expected result:
----------------
A continuous ping process should be running in the backgroud, independently of httpd. When httpd is closed, the ping (or whatever relevant) process should keep running.
Actual result:
--------------
When httpd is closed, the ping (or whatever relevant) process dies.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 22:00:01 2025 UTC |
Same behavior with: <?PHP session_write_close(); //Simple example to reproduce problematic forking exec("ping localhost </dev/null >/dev/null 2>/dev/null &"); ?>