Bug #15929 [Fbk->Bgs]: System_Daemon::restart();
| From: | kevin at vanzonneveld dot net | Date: | Mon, 02 Mar 2009 10:48:52 +0000 |
| Subject: | Bug #15929 [Fbk->Bgs]: System_Daemon::restart(); | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-103@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=15929&edit=1
ID: 15929
Updated by: kevin@vanzonneveld.net
Reported By: diemuzi at gmail dot com
Summary: System_Daemon::restart();
-Status: Feedback
+Status: Bogus
Type: Bug
Package: System_Daemon
Operating System: Archlinux
PHP Version: 5.2.8
Assigned To: kvz
Roadmap Versions:
New Comment:
<div id="changeset">
<span class="removed">-Status: Feedback</span>
<span class="added">+Status: Bogus</span>
</div>
Bug reported has mailed me that indeed he was using an older version.
Previous Comments:
------------------------------------------------------------------------
[2009-03-02 10:48:12] kvz
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-02-23 15:35:11] kvz
<div id="changeset">
<span class="removed">-Status: Assigned</span>
<span class="added">+Status: Feedback</span>
</div>
------------------------------------------------------------------------
[2009-02-23 15:34:56] kvz
<div id="changeset">
<span class="removed">-Assigned To:</span>
<span class="added">+Assigned To: kvz</span>
</div>
------------------------------------------------------------------------
[2009-02-23 13:59:45] kvz
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-22 22:32:47] diemuzi
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>
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=15929&edit=1