#24616 [Opn]: Process started with "exec cmd > /dev/null &" dies when httpd is closed

From: Date: Sat, 12 Jul 2003 06:07:27 +0000
Subject: #24616 [Opn]: Process started with "exec cmd > /dev/null &" dies when httpd is closed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-43793@lists.php.net to get a copy of this message
ID: 24616 User updated by: carb at videotron dot ca Reported By: carb at videotron dot ca Status: Open Bug Type: Apache related Operating System: RedHat 9.0 PHP Version: 4.3.2 New Comment: Same behavior with: <?PHP session_write_close(); //Simple example to reproduce problematic forking exec("ping localhost </dev/null >/dev/null 2>/dev/null &"); ?> Previous Comments: ------------------------------------------------------------------------ [2003-07-12 01:00:33] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24616&edit=1

« previous php.bugs (#43793) next »