Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.0

Bug #15929 System_Daemon::restart();
Submitted: 2009-02-23 03:32 UTC
From: diemuzi Assigned: kvz
Status: Bogus Package: System_Daemon
PHP Version: 5.2.8 OS: Archlinux
Roadmaps: (Not assigned)    
Subscription  


 [2009-02-23 03:32 UTC] diemuzi (Sammie Taunton)
Description: ------------ I tested this with my development code and something seemed odd as PHP started to go <defunct> on me. System_Daemon::start(); System_Daemon::restart(); System_Daemon::stop(); Using the restart() produced multiple PHP <defunct> items. Test script: --------------- #!/usr/local/bin/php -q <?php error_reporting(E_ALL); // Start System Daemon (PEAR) require_once "Daemon.php"; // Allowed arguments & their defaults $runmode = array( "no-daemon" => true, "help" => false, "write-initd" => false ); // Options $options = array( 'appName' => 'queue_test', 'appDir' => dirname(__FILE__), 'sysMaxExecutionTime' => '0', 'sysMaxInputTime' => '0', 'sysMemoryLimit' => '1024M' ); System_Daemon::setOptions($options); // Overrule the signal handler with any function System_Daemon::setSigHandler(SIGCONT, array("System_Daemon", "defaultSigHandler")); System_Daemon::start(); System_Daemon::restart(); System_Daemon::stop(); ?> Expected result: ---------------- I expected to see the Ssystem_Daemon::restart(); produce the following output: restarting queue_test daemon Actual result: -------------- /usr/local/bin/php -q ./otwebsoft_queue_test.php [otwebsoft_queue] <defunct>

Comments

 [2009-02-23 18:59 UTC] kvz (Kevin van Zonneveld)
I've rerun the test like this: http://trac.phpjs.org/projects/system_daemon/browser/trunk/examples/bug_test_b.php Watched the ps auxf, and finally killed it with: killall -9 bug_test_b.php But there weren't multiple zombie processes. I do get an occasional <defunct> but I think that is to be expected because a new child is spawned and then the parent dies. Anyway it's only there for a short while & then disappears. I was however able to reproduce this with an older version. If your defuncs are stacking up that really sounds like an old bug. In that case could you supply me with your: cat System/Daemon.php |grep GLOBAL And could you show me how you start the daemon from the commandline? On a sidenote: A stop() is not required as restart() will actually do this (quite ugly): die(exec(join(' ', $GLOBALS['argv']) . ' > /dev/null &')); So basically it kills the current process just before executing another one.
 [2009-02-23 20:34 UTC] kvz (Kevin van Zonneveld)
-Assigned To: +Assigned To: kvz
 [2009-02-23 20:35 UTC] kvz (Kevin van Zonneveld)
-Status: Assigned +Status: Feedback
 [2009-03-02 15:48 UTC] kvz (Kevin van Zonneveld)
Thank you for taking the time to report a problem with the package. Unfortunately you are not using a current version of the package -- the problem might already be fixed. Please download a new version from http://pear.php.net/packages.php If you are able to reproduce the bug with one of the latest versions, please change the package version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR. Bug reported has mailed me that indeed he was using an older version.
 [2009-03-02 15:48 UTC] kvz (Kevin van Zonneveld)
-Status: Feedback +Status: Bogus
Bug reported has mailed me that indeed he was using an older version.