<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=System_Daemon&amp;status=All</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/21041" />
      <rdf:li rdf:resource="http://pear.php.net/bug/20951" />
      <rdf:li rdf:resource="http://pear.php.net/bug/20062" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19958" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19919" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19915" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19792" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19634" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19607" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19601" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19589" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19577" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19499" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19333" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19287" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19241" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19140" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19121" />
      <rdf:li rdf:resource="http://pear.php.net/bug/19101" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18986" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18714" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18677" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18659" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18606" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18561" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18394" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18380" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18087" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18071" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18070" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18069" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18054" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18036" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17919" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17917" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17916" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17634" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17600" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17593" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17426" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17419" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17332" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17296" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17263" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17254" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17225" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17224" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17216" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17184" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17169" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17168" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17152" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17069" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16981" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16980" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16966" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16883" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16882" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16730" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16729" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16640" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16638" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16511" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16500" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16414" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16144" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16136" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16135" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15991" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15929" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15927" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15926" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15895" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15894" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15891" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14230" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/21041">
      <title>System_Daemon: Bug 21041 [Open] service status</title>
      <link>http://pear.php.net/bugs/21041</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by tomkraw
2016-03-16T22:00:35+00:00
PHP: 5.5.14 OS: Red Hat 6.7 Package Version: 1.0.0

Description:
------------
When service is installed with chkconfig add logparser and started the 
command &quot;service logparser status&quot; allways reports status &quot;stopped&quot;. 
But process is active and logparser is working. My php version is 5.3.3 
but I think it has nothing to do whith the problem.

Test script:
---------------
My script is based on the logparser.php example.

Expected result:
----------------
When service/daemon is started then status should be &quot;running&quot;

Actual result:
--------------
Service logparser status reports statss stopped.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by tomkraw
2016-03-16T22:00:35+00:00
PHP: 5.5.14 OS: Red Hat 6.7 Package Version: 1.0.0

Description:
------------
When service is installed with chkconfig add logparser and started the 
command &quot;service logparser status&quot; allways reports status &quot;stopped&quot;. 
But process is active and logparser is working. My php version is 5.3.3 
but I think it has nothing to do whith the problem.

Test script:
---------------
My script is based on the logparser.php example.

Expected result:
----------------
When service/daemon is started then status should be &quot;running&quot;

Actual result:
--------------
Service logparser status reports statss stopped.</pre>]]></description>
      <dc:date>2016-03-16T22:00:35+00:00</dc:date>
      <dc:creator>tomkrawc &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/20951">
      <title>System_Daemon: Feature/Change Request 20951 [Open] Please upgrade version to latest git</title>
      <link>http://pear.php.net/bugs/20951</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by shankao
2015-09-25T13:56:56+00:00
PHP: Irrelevant OS: Ubuntu Package Version: 1.0.0

Description:
------------
There's not been any official release for a long time, although 
bugs are fixed in the github version.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by shankao
2015-09-25T13:56:56+00:00
PHP: Irrelevant OS: Ubuntu Package Version: 1.0.0

Description:
------------
There's not been any official release for a long time, although 
bugs are fixed in the github version.</pre>]]></description>
      <dc:date>2015-09-25T13:56:56+00:00</dc:date>
      <dc:creator>shankao &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/20062">
      <title>System_Daemon: Bug 20062 [Closed] Path pidfile should not require at 4 elements in path</title>
      <link>http://pear.php.net/bugs/20062</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by hek2mgl
2013-09-13T20:38:48+00:00
PHP: Irrelevant OS: Ubuntu Package Version: 1.0.0

Description:
------------
I've just git cloned the package and wanted to run example/simple.php as a normal user not root. Of course the sample complained on the first try as it could not write to log and pidfile as there are per default would been written to /var/log/simple.log or /var/run/simple/simple.pid. 

I then tried to set the logLocation to `./test.log` and the appPidFileLocation to `test.pid`.

I got an error err: Since version 0.6.3, the pidfile needs to be in it's own subdirectory like: %s/simple/simple.pid [l:1463]

and ended up to configure the path like:

System_Daemon::setOption(&quot;appPidLocation&quot;, &quot;pid/simple/simple/simple/simple&quot;);

what looks really weird. The problem is caused by System/Daemon.php line 1458.

Is there any logic behind this? 


Test script:
---------------
I just used examples/simple.php

Expected result:
----------------
Possibility to configure appPidLocation like './simple.pid'

Actual result:
--------------
Since version 0.6.3, the pidfile needs to be in it's own subdirectory like: %s/simple/simple.pid [l:1463]</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by hek2mgl
2013-09-13T20:38:48+00:00
PHP: Irrelevant OS: Ubuntu Package Version: 1.0.0

Description:
------------
I've just git cloned the package and wanted to run example/simple.php as a normal user not root. Of course the sample complained on the first try as it could not write to log and pidfile as there are per default would been written to /var/log/simple.log or /var/run/simple/simple.pid. 

I then tried to set the logLocation to `./test.log` and the appPidFileLocation to `test.pid`.

I got an error err: Since version 0.6.3, the pidfile needs to be in it's own subdirectory like: %s/simple/simple.pid [l:1463]

and ended up to configure the path like:

System_Daemon::setOption(&quot;appPidLocation&quot;, &quot;pid/simple/simple/simple/simple&quot;);

what looks really weird. The problem is caused by System/Daemon.php line 1458.

Is there any logic behind this? 


Test script:
---------------
I just used examples/simple.php

Expected result:
----------------
Possibility to configure appPidLocation like './simple.pid'

Actual result:
--------------
Since version 0.6.3, the pidfile needs to be in it's own subdirectory like: %s/simple/simple.pid [l:1463]</pre>]]></description>
      <dc:date>2013-10-09T19:01:29+00:00</dc:date>
      <dc:creator>info &amp;#x61;&amp;#116; metashock &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19958">
      <title>System_Daemon: Bug 19958 [Closed] a small bug on abbr()</title>
      <link>http://pear.php.net/bugs/19958</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by trauma2u
2013-05-27T15:29:41+00:00
PHP: 5.4.15 OS:  Package Version: 1.0.0

Description:
------------
Just a small bug.
abbr() doesn't work when string length is below 30.
$cutAt param is given, but it's fixed to 30 on length check.


Test script:
---------------
System_Daemon::abbr('Kevin van zonneveld', 10);

Expected result:
----------------
Kevin v...

Actual result:
--------------
Kevin van zonneveld</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by trauma2u
2013-05-27T15:29:41+00:00
PHP: 5.4.15 OS:  Package Version: 1.0.0

Description:
------------
Just a small bug.
abbr() doesn't work when string length is below 30.
$cutAt param is given, but it's fixed to 30 on length check.


Test script:
---------------
System_Daemon::abbr('Kevin van zonneveld', 10);

Expected result:
----------------
Kevin v...

Actual result:
--------------
Kevin van zonneveld</pre>]]></description>
      <dc:date>2013-05-27T15:53:14+00:00</dc:date>
      <dc:creator>trauma2u &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19919">
      <title>System_Daemon: Bug 19919 [Closed] Add support for E_STRICT errors</title>
      <link>http://pear.php.net/bugs/19919</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by shankao
2013-04-29T19:51:27+00:00
PHP: 5.4.9 OS: ubuntu Package Version: 1.0.0

Description:
------------
The error levels array does not include E_STRICT errors. A 
possible fix would be this:

=== modified file 'lib/pear/php/System/Daemon.php'
--- lib/pear/php/System/Daemon.php	2013-04-28 
04:20:10 +0000
+++ lib/pear/php/System/Daemon.php	2013-04-29 
13:44:57 +0000
@@ -148,6 +148,7 @@
         E_USER_ERROR =&gt; array(self::LOG_ERR, 'User 
Error'),
         E_USER_WARNING =&gt; array(self::LOG_WARNING, 
'User Warning'),
         E_USER_NOTICE =&gt; array(self::LOG_DEBUG, 'User 
Notice'),
+        E_STRICT =&gt; array(self::LOG_DEBUG, 'Strict'),
         'E_RECOVERABLE_ERROR' =&gt; 
array(self::LOG_WARNING, 'Recoverable Error'),
         'E_DEPRECATED' =&gt; array(self::LOG_NOTICE, 
'Deprecated'),
         'E_USER_DEPRECATED' =&gt; 
array(self::LOG_NOTICE, 'User Deprecated'),</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by shankao
2013-04-29T19:51:27+00:00
PHP: 5.4.9 OS: ubuntu Package Version: 1.0.0

Description:
------------
The error levels array does not include E_STRICT errors. A 
possible fix would be this:

=== modified file 'lib/pear/php/System/Daemon.php'
--- lib/pear/php/System/Daemon.php	2013-04-28 
04:20:10 +0000
+++ lib/pear/php/System/Daemon.php	2013-04-29 
13:44:57 +0000
@@ -148,6 +148,7 @@
         E_USER_ERROR =&gt; array(self::LOG_ERR, 'User 
Error'),
         E_USER_WARNING =&gt; array(self::LOG_WARNING, 
'User Warning'),
         E_USER_NOTICE =&gt; array(self::LOG_DEBUG, 'User 
Notice'),
+        E_STRICT =&gt; array(self::LOG_DEBUG, 'Strict'),
         'E_RECOVERABLE_ERROR' =&gt; 
array(self::LOG_WARNING, 'Recoverable Error'),
         'E_DEPRECATED' =&gt; array(self::LOG_NOTICE, 
'Deprecated'),
         'E_USER_DEPRECATED' =&gt; 
array(self::LOG_NOTICE, 'User Deprecated'),</pre>]]></description>
      <dc:date>2013-07-12T18:18:29+00:00</dc:date>
      <dc:creator>shankao &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19915">
      <title>System_Daemon: Bug 19915 [Closed] _summon() result is not checked/returned</title>
      <link>http://pear.php.net/bugs/19915</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by shankao
2013-04-29T10:32:54+00:00
PHP: Irrelevant OS: Ubuntu Package Version: 1.0.0

Description:
------------
At the end of start():
...
// Become daemon
self::_summon();

return true;
...

The function returns true no matter what is the result of the 
_summon() function. It would be better to change it to:

return self::_summon();</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by shankao
2013-04-29T10:32:54+00:00
PHP: Irrelevant OS: Ubuntu Package Version: 1.0.0

Description:
------------
At the end of start():
...
// Become daemon
self::_summon();

return true;
...

The function returns true no matter what is the result of the 
_summon() function. It would be better to change it to:

return self::_summon();</pre>]]></description>
      <dc:date>2013-04-29T17:20:28+00:00</dc:date>
      <dc:creator>shankao &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19792">
      <title>System_Daemon: Bug 19792 [Bogus] System_Daemon::_ilog function includes some unsafe index usage</title>
      <link>http://pear.php.net/bugs/19792</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by darrasin
2013-01-17T03:50:33+00:00
PHP: 5.3.3 OS: Linux Package Version: 1.0.0

Description:
------------
In the System_Daemon::_ilog() function there are some unsafe references on indexes that may not be set, which in some circumstances can lead to PHP Warnings and exceptions in our case.

The lines in question start on line 1005 of the Damon.php file:

$class    = (string)@$dbg_bt[($history-1)]['class'];
$function = (string)@$dbg_bt[($history-1)]['function'];

The 'class' and 'function' indexes are not always set in this context and the unchecked references can lead to warnings and/or exceptions.

I propose to replace these lines with the following that includes a check of the those indexes before their use:

$class    = (isset($dbg_bt[$history-1]['class'])?$dbg_bt[$history-1]['class']:'');
$function = (isset($dbg_bt[$history-1]['function'])?$dbg_bt[$history-1]['function']:'');

Note that lines were inspired by similar code already present within this file, please see lines 1088-1089 of the same file.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by darrasin
2013-01-17T03:50:33+00:00
PHP: 5.3.3 OS: Linux Package Version: 1.0.0

Description:
------------
In the System_Daemon::_ilog() function there are some unsafe references on indexes that may not be set, which in some circumstances can lead to PHP Warnings and exceptions in our case.

The lines in question start on line 1005 of the Damon.php file:

$class    = (string)@$dbg_bt[($history-1)]['class'];
$function = (string)@$dbg_bt[($history-1)]['function'];

The 'class' and 'function' indexes are not always set in this context and the unchecked references can lead to warnings and/or exceptions.

I propose to replace these lines with the following that includes a check of the those indexes before their use:

$class    = (isset($dbg_bt[$history-1]['class'])?$dbg_bt[$history-1]['class']:'');
$function = (isset($dbg_bt[$history-1]['function'])?$dbg_bt[$history-1]['function']:'');

Note that lines were inspired by similar code already present within this file, please see lines 1088-1089 of the same file.</pre>]]></description>
      <dc:date>2013-02-12T16:27:16+00:00</dc:date>
      <dc:creator>darrasin &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19634">
      <title>System_Daemon: Bug 19634 [Bogus] System_Daemon::restart() is unreliable!</title>
      <link>http://pear.php.net/bugs/19634</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by cisco211
2012-10-04T00:44:15+00:00
PHP: 5.2.6 OS: Debian 5.0.10 (Lenny) Package Version: 1.0.0

Description:
------------
Sometimes restarting wont work (not sure whats the exact 
reason).

I hacked the _die() function in Daemon.php a bit to bypass the 
the problem.

I replaced the line:

die(exec(join(' ', $GLOBALS['argv']) . ' &gt; /dev/null &amp;'));

with:

$cmd = join(' ', $GLOBALS['argv']) . ' &gt; /dev/null 2&gt;&amp;1 &amp;';
$file = 
self::getOption('appDir').DIRECTORY_SEPARATOR.md5(time()
).'.sh';
$data = &lt;&lt;&lt;ENDSH
#!/bin/sh
sleep 5
{$cmd}
rm $0
ENDSH;
file_put_contents($file,$data);
chmod($file,0777);
exec($file);
exit();

this will write a temporary sh file which sleeps 5 seconds and 
then executes the command.
the sh file gets deleted after execution, thx to the rm $0

Note: my daemon script is using arguments, the argument 
&quot;start&quot; is executing the script as daemon. to restart it i use the 
argument &quot;restart&quot; on 
the same script which send the command to the running 
process (process is reading it from fifo).

Test script:
---------------
Use any example.

Expected result:
----------------
restart() ever works

Actual result:
--------------
Sometimes restart() works, sometimes restart() works not.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by cisco211
2012-10-04T00:44:15+00:00
PHP: 5.2.6 OS: Debian 5.0.10 (Lenny) Package Version: 1.0.0

Description:
------------
Sometimes restarting wont work (not sure whats the exact 
reason).

I hacked the _die() function in Daemon.php a bit to bypass the 
the problem.

I replaced the line:

die(exec(join(' ', $GLOBALS['argv']) . ' &gt; /dev/null &amp;'));

with:

$cmd = join(' ', $GLOBALS['argv']) . ' &gt; /dev/null 2&gt;&amp;1 &amp;';
$file = 
self::getOption('appDir').DIRECTORY_SEPARATOR.md5(time()
).'.sh';
$data = &lt;&lt;&lt;ENDSH
#!/bin/sh
sleep 5
{$cmd}
rm $0
ENDSH;
file_put_contents($file,$data);
chmod($file,0777);
exec($file);
exit();

this will write a temporary sh file which sleeps 5 seconds and 
then executes the command.
the sh file gets deleted after execution, thx to the rm $0

Note: my daemon script is using arguments, the argument 
&quot;start&quot; is executing the script as daemon. to restart it i use the 
argument &quot;restart&quot; on 
the same script which send the command to the running 
process (process is reading it from fifo).

Test script:
---------------
Use any example.

Expected result:
----------------
restart() ever works

Actual result:
--------------
Sometimes restart() works, sometimes restart() works not.</pre>]]></description>
      <dc:date>2012-10-09T04:02:30+00:00</dc:date>
      <dc:creator>TjSBMD1810 &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19607">
      <title>System_Daemon: Bug 19607 [Closed] Undefined variable: logLvl</title>
      <link>http://pear.php.net/bugs/19607</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by flemm
2012-09-19T18:39:04+00:00
PHP: 5.4.7 OS: debian squeeze Package Version: 1.0.0

Description:
------------
PHP Notice:  Undefined variable: logLvl in /usr/share/php/System/Daemon.php on line 804
PHP Notice:  Undefined index:  in /usr/share/php/System/Daemon.php on line 1097</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by flemm
2012-09-19T18:39:04+00:00
PHP: 5.4.7 OS: debian squeeze Package Version: 1.0.0

Description:
------------
PHP Notice:  Undefined variable: logLvl in /usr/share/php/System/Daemon.php on line 804
PHP Notice:  Undefined index:  in /usr/share/php/System/Daemon.php on line 1097</pre>]]></description>
      <dc:date>2012-09-19T19:07:43+00:00</dc:date>
      <dc:creator>fabian &amp;#x64;&amp;#111;&amp;#x74; lemm &amp;#x61;&amp;#116; tacticx &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19601">
      <title>System_Daemon: Bug 19601 [Bogus] PHP 5.3 - System_Daemon::writeAutoRun Error</title>
      <link>http://pear.php.net/bugs/19601</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by exu_pear
2012-09-11T17:11:41+00:00
PHP: 5.3.10 OS: Ubuntu 12.04 LTS Package Version: 1.0.0

Description:
------------
I can't generate deamon start scripts, it's related with PHP strict 
standards



Test script:
---------------
#!/usr/bin/php -q
&lt;?php
/**
 * System_Daemon turns PHP-CLI scripts into daemons.
 *
 * PHP version 5
 *
 * @category  System
 * @package   System_Daemon
 * @author    Kevin &lt;kevin@vanzonneveld.net&gt;
 * @copyright 2008 Kevin van Zonneveld
 * @license   http://www.opensource.org/licenses/bsd-license.php
 * @link      http://github.com/kvz/system_daemon
 */
 
/**
 * System_Daemon Example Code
 *
 * If you run this code successfully, a daemon will be spawned
 * but unless have already generated the init.d script, you have
 * no real way of killing it yet.
 *
 * In this case wait 3 runs, which is the maximum for this example.
 *
 *
 * In panic situations, you can always kill you daemon by typing
 *
 * killall -9 logparser.php
 * OR:
 * killall -9 php
 *
 */
 
// Allowed arguments &amp; their defaults
$runmode = array(
    'no-daemon' =&gt; false,
    'help' =&gt; false,
    'write-initd' =&gt; false,
);
 
// Scan command line attributes for allowed arguments
foreach ($argv as $k=&gt;$arg) {
    if (substr($arg, 0, 2) == '--' &amp;&amp; isset($runmode[substr($arg, 2)])) {
        $runmode[substr($arg, 2)] = true;
    }
}
 
// Help mode. Shows allowed argumentents and quit directly
if ($runmode['help'] == true) {
    echo 'Usage: '.$argv[0].' [runmode]' . &quot;\n&quot;;
    echo 'Available runmodes:' . &quot;\n&quot;;
    foreach ($runmode as $runmod=&gt;$val) {
        echo ' --'.$runmod . &quot;\n&quot;;
    }
    die();
}
 
// Make it possible to test in source directory
// This is for PEAR developers only
ini_set('include_path', ini_get('include_path').':..');
 
// Include Class
error_reporting(E_STRICT);
require_once 'System/Daemon.php';
 
// Setup
$options = array(
    'appName' =&gt; 'logparser',
    'appDir' =&gt; dirname(__FILE__),
    'appDescription' =&gt; 'Parses vsftpd logfiles and stores them in MySQL',
    'authorName' =&gt; 'Kevin van Zonneveld',
    'authorEmail' =&gt; 'kevin@vanzonneveld.net',
    'sysMaxExecutionTime' =&gt; '0',
    'sysMaxInputTime' =&gt; '0',
    'sysMemoryLimit' =&gt; '1024M',
    'appRunAsGID' =&gt; 1000,
    'appRunAsUID' =&gt; 1000,
);
 
System_Daemon::setOptions($options);
 
// This program can also be run in the forground with runmode --no-daemon
if (!$runmode['no-daemon']) {
    // Spawn Daemon
    System_Daemon::start();
}
 
// With the runmode --write-initd, this program can automatically write a
// system startup file called: 'init.d'
// This will make sure your daemon will be started on reboot
if (!$runmode['write-initd']) {
    System_Daemon::info('not writing an init.d script this time');
} else {
    if (($initd_location = System_Daemon::writeAutoRun()) === false) {
        System_Daemon::notice('unable to write init.d script');
    } else {
        System_Daemon::info(
            'sucessfully written startup script: %s',
            $initd_location
        );
    }
}
 
// Run your code
// Here comes your own actual code
 
// This variable gives your own code the ability to breakdown the daemon:
$runningOkay = true;
 
// This variable keeps track of how many 'runs' or 'loops' your daemon has
// done so far. For example purposes, we're quitting on 3.
$cnt = 1;
 
// While checks on 3 things in this case:
// - That the Daemon Class hasn't reported it's dying
// - That your own code has been running Okay
// - That we're not executing more than 3 runs
while (!System_Daemon::isDying() &amp;&amp; $runningOkay &amp;&amp; $cnt &lt;=3) {
    // What mode are we in?
    $mode = '&quot;'.(System_Daemon::isInBackground() ? '' : 'non-' ).
        'daemon&quot; mode';
 
    // Log something using the Daemon class's logging facility
    // Depending on runmode it will either end up:
    //  - In the /var/log/logparser.log
    //  - On screen (in case we're not a daemon yet)
    System_Daemon::info('{appName} running in %s %s/3',
        $mode,
        $cnt
    );
 
    // In the actuall logparser program, You could replace 'true'
    // With e.g. a  parseLog('vsftpd') function, and have it return
    // either true on success, or false on failure.
    $runningOkay = true;
    //$runningOkay = parseLog('vsftpd');
 
    // Should your parseLog('vsftpd') return false, then
    // the daemon is automatically shut down.
    // An extra log entry would be nice, we're using level 3,
    // which is critical.
    // Level 4 would be fatal and shuts down the daemon immediately,
    // which in this case is handled by the while condition.
    if (!$runningOkay) {
        System_Daemon::err('parseLog() produced an error, '.
            'so this will be my last run');
    }
 
    // Relax the system by sleeping for a little bit
    // iterate also clears statcache
    System_Daemon::iterate(2);
 
    $cnt++;
}
 
// Shut down the daemon nicely
// This is ignored if the class is actually running in the foreground
System_Daemon::stop();

Expected result:
----------------
File logparser in /etc/init.d/

Actual result:
--------------
sudo php deamon_test.php --write-initd
[Sep 11 14:06:03]   notice: Starting logparser daemon, output 
in: '/var/log/logparser.log'
PHP Strict standards:  array_map() expects parameter 1 to be 
a valid callback, non-static method 
System_Daemon_OS::_getAncestorCount() should not be 
called statically in /usr/share/php/System/Daemon/OS.php on 
line 549
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144
PHP   6. array_map() 
/usr/share/php/System/Daemon/OS.php:549
PHP Strict standards:  Non-static method 
System_Daemon_OS::_getAncestors() should not be called 
statically in /usr/share/php/System/Daemon/OS.php on line 
580
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144
PHP   6. array_map() 
/usr/share/php/System/Daemon/OS.php:549
PHP   7. System_Daemon_OS::_getAncestorCount() 
/usr/share/php/System/Daemon/OS.php:549
PHP Strict standards:  Non-static method 
System_Daemon_OS::_getAncestors() should not be called 
statically in /usr/share/php/System/Daemon/OS.php on line 
580
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144
PHP   6. array_map() 
/usr/share/php/System/Daemon/OS.php:549
PHP   7. System_Daemon_OS::_getAncestorCount() 
/usr/share/php/System/Daemon/OS.php:549
PHP Strict standards:  Non-static method 
System_Daemon_OS::_getAncestors() should not be called 
statically in /usr/share/php/System/Daemon/OS.php on line 
580
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144
PHP   6. array_map() 
/usr/share/php/System/Daemon/OS.php:549
PHP   7. System_Daemon_OS::_getAncestorCount() 
/usr/share/php/System/Daemon/OS.php:549
PHP Strict standards:  Only variables should be passed by 
reference in /usr/share/php/System/Daemon/OS.php on line 
551
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by exu_pear
2012-09-11T17:11:41+00:00
PHP: 5.3.10 OS: Ubuntu 12.04 LTS Package Version: 1.0.0

Description:
------------
I can't generate deamon start scripts, it's related with PHP strict 
standards



Test script:
---------------
#!/usr/bin/php -q
&lt;?php
/**
 * System_Daemon turns PHP-CLI scripts into daemons.
 *
 * PHP version 5
 *
 * @category  System
 * @package   System_Daemon
 * @author    Kevin &lt;kevin@vanzonneveld.net&gt;
 * @copyright 2008 Kevin van Zonneveld
 * @license   http://www.opensource.org/licenses/bsd-license.php
 * @link      http://github.com/kvz/system_daemon
 */
 
/**
 * System_Daemon Example Code
 *
 * If you run this code successfully, a daemon will be spawned
 * but unless have already generated the init.d script, you have
 * no real way of killing it yet.
 *
 * In this case wait 3 runs, which is the maximum for this example.
 *
 *
 * In panic situations, you can always kill you daemon by typing
 *
 * killall -9 logparser.php
 * OR:
 * killall -9 php
 *
 */
 
// Allowed arguments &amp; their defaults
$runmode = array(
    'no-daemon' =&gt; false,
    'help' =&gt; false,
    'write-initd' =&gt; false,
);
 
// Scan command line attributes for allowed arguments
foreach ($argv as $k=&gt;$arg) {
    if (substr($arg, 0, 2) == '--' &amp;&amp; isset($runmode[substr($arg, 2)])) {
        $runmode[substr($arg, 2)] = true;
    }
}
 
// Help mode. Shows allowed argumentents and quit directly
if ($runmode['help'] == true) {
    echo 'Usage: '.$argv[0].' [runmode]' . &quot;\n&quot;;
    echo 'Available runmodes:' . &quot;\n&quot;;
    foreach ($runmode as $runmod=&gt;$val) {
        echo ' --'.$runmod . &quot;\n&quot;;
    }
    die();
}
 
// Make it possible to test in source directory
// This is for PEAR developers only
ini_set('include_path', ini_get('include_path').':..');
 
// Include Class
error_reporting(E_STRICT);
require_once 'System/Daemon.php';
 
// Setup
$options = array(
    'appName' =&gt; 'logparser',
    'appDir' =&gt; dirname(__FILE__),
    'appDescription' =&gt; 'Parses vsftpd logfiles and stores them in MySQL',
    'authorName' =&gt; 'Kevin van Zonneveld',
    'authorEmail' =&gt; 'kevin@vanzonneveld.net',
    'sysMaxExecutionTime' =&gt; '0',
    'sysMaxInputTime' =&gt; '0',
    'sysMemoryLimit' =&gt; '1024M',
    'appRunAsGID' =&gt; 1000,
    'appRunAsUID' =&gt; 1000,
);
 
System_Daemon::setOptions($options);
 
// This program can also be run in the forground with runmode --no-daemon
if (!$runmode['no-daemon']) {
    // Spawn Daemon
    System_Daemon::start();
}
 
// With the runmode --write-initd, this program can automatically write a
// system startup file called: 'init.d'
// This will make sure your daemon will be started on reboot
if (!$runmode['write-initd']) {
    System_Daemon::info('not writing an init.d script this time');
} else {
    if (($initd_location = System_Daemon::writeAutoRun()) === false) {
        System_Daemon::notice('unable to write init.d script');
    } else {
        System_Daemon::info(
            'sucessfully written startup script: %s',
            $initd_location
        );
    }
}
 
// Run your code
// Here comes your own actual code
 
// This variable gives your own code the ability to breakdown the daemon:
$runningOkay = true;
 
// This variable keeps track of how many 'runs' or 'loops' your daemon has
// done so far. For example purposes, we're quitting on 3.
$cnt = 1;
 
// While checks on 3 things in this case:
// - That the Daemon Class hasn't reported it's dying
// - That your own code has been running Okay
// - That we're not executing more than 3 runs
while (!System_Daemon::isDying() &amp;&amp; $runningOkay &amp;&amp; $cnt &lt;=3) {
    // What mode are we in?
    $mode = '&quot;'.(System_Daemon::isInBackground() ? '' : 'non-' ).
        'daemon&quot; mode';
 
    // Log something using the Daemon class's logging facility
    // Depending on runmode it will either end up:
    //  - In the /var/log/logparser.log
    //  - On screen (in case we're not a daemon yet)
    System_Daemon::info('{appName} running in %s %s/3',
        $mode,
        $cnt
    );
 
    // In the actuall logparser program, You could replace 'true'
    // With e.g. a  parseLog('vsftpd') function, and have it return
    // either true on success, or false on failure.
    $runningOkay = true;
    //$runningOkay = parseLog('vsftpd');
 
    // Should your parseLog('vsftpd') return false, then
    // the daemon is automatically shut down.
    // An extra log entry would be nice, we're using level 3,
    // which is critical.
    // Level 4 would be fatal and shuts down the daemon immediately,
    // which in this case is handled by the while condition.
    if (!$runningOkay) {
        System_Daemon::err('parseLog() produced an error, '.
            'so this will be my last run');
    }
 
    // Relax the system by sleeping for a little bit
    // iterate also clears statcache
    System_Daemon::iterate(2);
 
    $cnt++;
}
 
// Shut down the daemon nicely
// This is ignored if the class is actually running in the foreground
System_Daemon::stop();

Expected result:
----------------
File logparser in /etc/init.d/

Actual result:
--------------
sudo php deamon_test.php --write-initd
[Sep 11 14:06:03]   notice: Starting logparser daemon, output 
in: '/var/log/logparser.log'
PHP Strict standards:  array_map() expects parameter 1 to be 
a valid callback, non-static method 
System_Daemon_OS::_getAncestorCount() should not be 
called statically in /usr/share/php/System/Daemon/OS.php on 
line 549
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144
PHP   6. array_map() 
/usr/share/php/System/Daemon/OS.php:549
PHP Strict standards:  Non-static method 
System_Daemon_OS::_getAncestors() should not be called 
statically in /usr/share/php/System/Daemon/OS.php on line 
580
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144
PHP   6. array_map() 
/usr/share/php/System/Daemon/OS.php:549
PHP   7. System_Daemon_OS::_getAncestorCount() 
/usr/share/php/System/Daemon/OS.php:549
PHP Strict standards:  Non-static method 
System_Daemon_OS::_getAncestors() should not be called 
statically in /usr/share/php/System/Daemon/OS.php on line 
580
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144
PHP   6. array_map() 
/usr/share/php/System/Daemon/OS.php:549
PHP   7. System_Daemon_OS::_getAncestorCount() 
/usr/share/php/System/Daemon/OS.php:549
PHP Strict standards:  Non-static method 
System_Daemon_OS::_getAncestors() should not be called 
statically in /usr/share/php/System/Daemon/OS.php on line 
580
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144
PHP   6. array_map() 
/usr/share/php/System/Daemon/OS.php:549
PHP   7. System_Daemon_OS::_getAncestorCount() 
/usr/share/php/System/Daemon/OS.php:549
PHP Strict standards:  Only variables should be passed by 
reference in /usr/share/php/System/Daemon/OS.php on line 
551
PHP Stack trace:
PHP   1. {main}() /home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:0
PHP   2. System_Daemon::writeAutoRun() 
/home/exu/Workspace/crm-
2/lib/workers/deamon_test.php:94
PHP   3. System_Daemon::_osObjSetup() 
/usr/share/php/System/Daemon.php:1170
PHP   4. System_Daemon_OS::factory() 
/usr/share/php/System/Daemon.php:1641
PHP   5. System_Daemon_OS::_mostSpecific() 
/usr/share/php/System/Daemon/OS.php:144</pre>]]></description>
      <dc:date>2012-09-18T15:35:07+00:00</dc:date>
      <dc:creator>jacek &amp;#x64;&amp;#111;&amp;#x74; wysocki+pear_sd_bug &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19589">
      <title>System_Daemon: Bug 19589 [Closed] setSigHandler() fails for these &quot;string&quot; signals</title>
      <link>http://pear.php.net/bugs/19589</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by virtual_void
2012-08-28T14:35:17+00:00
PHP: 5.3.15 OS: Gentoo x86_64 Package Version: 1.0.0

Description:
------------
When calling setSigHandler() before start(), it fails on these &quot;string&quot; signals because they aren't yet replaced by the actual signo.

Problem is Line 679, Deamon.php:
if (!isset(self::$_sigHandlers[$signal])) {

$signal is int, _sigHandlers array still holds string...

Easy solution: Just move the signal &quot;replacement&quot; code from start() to autoload()


Test script:
---------------
System_Daemon::setSigHandler(SIGCHLD, &quot;sighandler&quot;);

Expected result:
----------------
Successfull installation of the signal handler

Actual result:
--------------
Failing</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by virtual_void
2012-08-28T14:35:17+00:00
PHP: 5.3.15 OS: Gentoo x86_64 Package Version: 1.0.0

Description:
------------
When calling setSigHandler() before start(), it fails on these &quot;string&quot; signals because they aren't yet replaced by the actual signo.

Problem is Line 679, Deamon.php:
if (!isset(self::$_sigHandlers[$signal])) {

$signal is int, _sigHandlers array still holds string...

Easy solution: Just move the signal &quot;replacement&quot; code from start() to autoload()


Test script:
---------------
System_Daemon::setSigHandler(SIGCHLD, &quot;sighandler&quot;);

Expected result:
----------------
Successfull installation of the signal handler

Actual result:
--------------
Failing</pre>]]></description>
      <dc:date>2012-09-18T15:32:24+00:00</dc:date>
      <dc:creator>b-o-s-s &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19577">
      <title>System_Daemon: Bug 19577 [Closed] SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK are treated as signal constants</title>
      <link>http://pear.php.net/bugs/19577</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by joris
2012-08-23T00:13:16+00:00
PHP: 5.3.3 OS: Debian (Squeeze) Package Version: 1.0.0

Description:
------------
The SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK are treated as signal constants. However these constants are used in the  pcntl_sigprocmask (http://php.net/manual/en/function.pcntl-sigprocmask.php) for another purpose.

This leads to some unexpected behaviour, because these constants share there values with the signal constants. This becomes a real problem, because a custom callback for a SIGHUP signal is overwritten when starting the daemon (calling start()). This makes it impossible for me to create a custom restart callback.

The solution is to remove the following lines from the $_sigHandlers array (line 422):
'SIG_BLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
'SIG_UNBLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
'SIG_SETMASK' =&gt; array('System_Daemon', 'defaultSigHandler'),

Test script:
---------------
// set signal handler for SIGHUP signal
System_Daemon::setSigHandler(SIGHUP, function($signo) {
    System_Daemon::debug('Restarting!');
    System_Daemon::restart();
});
// start daemon
System_Daemon::start();

// Now my custom callback is suddenly overwritten with the default callback


Expected result:
----------------
When sending a HUP signal to the process my custom SIGHUP signal handler should be executed. 

Actual result:
--------------
The default signal handler in System_Daemon is called, because the code in System_Daemon::start() causes my custom signal handler to be overwritten.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by joris
2012-08-23T00:13:16+00:00
PHP: 5.3.3 OS: Debian (Squeeze) Package Version: 1.0.0

Description:
------------
The SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK are treated as signal constants. However these constants are used in the  pcntl_sigprocmask (http://php.net/manual/en/function.pcntl-sigprocmask.php) for another purpose.

This leads to some unexpected behaviour, because these constants share there values with the signal constants. This becomes a real problem, because a custom callback for a SIGHUP signal is overwritten when starting the daemon (calling start()). This makes it impossible for me to create a custom restart callback.

The solution is to remove the following lines from the $_sigHandlers array (line 422):
'SIG_BLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
'SIG_UNBLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
'SIG_SETMASK' =&gt; array('System_Daemon', 'defaultSigHandler'),

Test script:
---------------
// set signal handler for SIGHUP signal
System_Daemon::setSigHandler(SIGHUP, function($signo) {
    System_Daemon::debug('Restarting!');
    System_Daemon::restart();
});
// start daemon
System_Daemon::start();

// Now my custom callback is suddenly overwritten with the default callback


Expected result:
----------------
When sending a HUP signal to the process my custom SIGHUP signal handler should be executed. 

Actual result:
--------------
The default signal handler in System_Daemon is called, because the code in System_Daemon::start() causes my custom signal handler to be overwritten.</pre>]]></description>
      <dc:date>2012-08-23T18:34:01+00:00</dc:date>
      <dc:creator>joris &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19499">
      <title>System_Daemon: Bug 19499 [Bogus] run daemon via ssh hangs till Ctrl-C</title>
      <link>http://pear.php.net/bugs/19499</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by alinex
2012-07-10T02:10:15+00:00
PHP: 5.3.6 OS: Debian Package Version: 1.0.0

Description:
------------
I can start the logparser.php example script locally in daemon mode without problem, but if 
I call it from an ssh shell it hangs till I hit Ctrl-C, how can I avoid this?</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by alinex
2012-07-10T02:10:15+00:00
PHP: 5.3.6 OS: Debian Package Version: 1.0.0

Description:
------------
I can start the logparser.php example script locally in daemon mode without problem, but if 
I call it from an ssh shell it hangs till I hit Ctrl-C, how can I avoid this?</pre>]]></description>
      <dc:date>2012-07-17T16:14:23+00:00</dc:date>
      <dc:creator>alexander &amp;#x64;&amp;#111;&amp;#x74; schilling &amp;#x61;&amp;#116; soforthoeren &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19333">
      <title>System_Daemon: Feature/Change Request 19333 [Closed] Assignment in Condition</title>
      <link>http://pear.php.net/bugs/19333</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by diemuzi
2012-03-15T22:48:33+00:00
PHP: 5.4.0 OS: Archlinux Package Version: 1.0.0

Description:
------------
In the file System/Daemon/OS.php there exists an Assignment in Condition on line 324:

if (($rm = file_exists($path))) {

Although this doesn't pose any risk, I'd suggest writing it this way to remove the Assignment in Condition notice:

if (false !== ($rm = file_exists($path))) {

The same exists on line 593:

while ($class = get_parent_class($class)) {

Again I would recommend writing it this way:

while (false !== ($class = get_parent_class($class))) {</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by diemuzi
2012-03-15T22:48:33+00:00
PHP: 5.4.0 OS: Archlinux Package Version: 1.0.0

Description:
------------
In the file System/Daemon/OS.php there exists an Assignment in Condition on line 324:

if (($rm = file_exists($path))) {

Although this doesn't pose any risk, I'd suggest writing it this way to remove the Assignment in Condition notice:

if (false !== ($rm = file_exists($path))) {

The same exists on line 593:

while ($class = get_parent_class($class)) {

Again I would recommend writing it this way:

while (false !== ($class = get_parent_class($class))) {</pre>]]></description>
      <dc:date>2012-03-16T18:57:43+00:00</dc:date>
      <dc:creator>diemuzi &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19287">
      <title>System_Daemon: Bug 19287 [Bogus] Weird autorun template</title>
      <link>http://pear.php.net/bugs/19287</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by ronnil
2012-02-11T04:07:44+00:00
PHP: 5.3.10 OS: FreeBSD Package Version: 1.0.0RC1

Description:
------------
The template_BSD file in the datadir contains a startup 
script for mysql in stead of an actual template-file.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by ronnil
2012-02-11T04:07:44+00:00
PHP: 5.3.10 OS: FreeBSD Package Version: 1.0.0RC1

Description:
------------
The template_BSD file in the datadir contains a startup 
script for mysql in stead of an actual template-file.</pre>]]></description>
      <dc:date>2012-07-17T16:14:21+00:00</dc:date>
      <dc:creator>ronni &amp;#x61;&amp;#116; diku &amp;#x64;&amp;#111;&amp;#x74; dk</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19241">
      <title>System_Daemon: Bug 19241 [Bogus] Error stop service in ubuntu</title>
      <link>http://pear.php.net/bugs/19241</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by overlord
2012-01-23T23:43:09+00:00
PHP: 5.3.0 OS: Ubuntu 11.10 Package Version: 1.0.0RC1

Description:
------------
On ubuntu when I sart the created demon it run but when I try to stop it , don't work

Expected result:
----------------
clean stop

Actual result:
--------------
 /etc/init.d/photoservice stop
start-stop-daemon: warning: this system is not able to track process names
longer than 15 characters, please use --exec instead of --name.

deamon is not stoped</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by overlord
2012-01-23T23:43:09+00:00
PHP: 5.3.0 OS: Ubuntu 11.10 Package Version: 1.0.0RC1

Description:
------------
On ubuntu when I sart the created demon it run but when I try to stop it , don't work

Expected result:
----------------
clean stop

Actual result:
--------------
 /etc/init.d/photoservice stop
start-stop-daemon: warning: this system is not able to track process names
longer than 15 characters, please use --exec instead of --name.

deamon is not stoped</pre>]]></description>
      <dc:date>2012-07-17T16:14:19+00:00</dc:date>
      <dc:creator>mc &amp;#x61;&amp;#116; overlorddvlp &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19140">
      <title>System_Daemon: Bug 19140 [Closed] PHP Warning regarding date and system timezone reliance</title>
      <link>http://pear.php.net/bugs/19140</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by jdandrea
2011-12-16T21:14:55+00:00
PHP: 5.3.8 OS: RHEL6 Package Version: 1.0.0RC1

Description:
------------
PHP Warning:  date(): It is not safe to rely on the system's 
timezone settings. You are *required* to use the date.timezone 
setting or the date_default_timezone_set() function. In case you 
used any of those methods and you are still getting this 
warning, you most likely misspelled the timezone identifier. We 
selected 'America/Chicago' for 'CST/-6.0/no DST' instead in 
/usr/share/pear/System/Daemon.php on line 1045

Test script:
---------------
Use https://pear.php.net/manual/en/package.system.system-daemon.examples.simple.php - this replicates the problem on my RHEL6 install.

Expected result:
----------------
No PHP Warnings</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by jdandrea
2011-12-16T21:14:55+00:00
PHP: 5.3.8 OS: RHEL6 Package Version: 1.0.0RC1

Description:
------------
PHP Warning:  date(): It is not safe to rely on the system's 
timezone settings. You are *required* to use the date.timezone 
setting or the date_default_timezone_set() function. In case you 
used any of those methods and you are still getting this 
warning, you most likely misspelled the timezone identifier. We 
selected 'America/Chicago' for 'CST/-6.0/no DST' instead in 
/usr/share/pear/System/Daemon.php on line 1045

Test script:
---------------
Use https://pear.php.net/manual/en/package.system.system-daemon.examples.simple.php - this replicates the problem on my RHEL6 install.

Expected result:
----------------
No PHP Warnings</pre>]]></description>
      <dc:date>2011-12-16T22:49:23+00:00</dc:date>
      <dc:creator>joe &amp;#x61;&amp;#116; liquidjoe &amp;#x64;&amp;#111;&amp;#x74; biz</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19121">
      <title>System_Daemon: Bug 19121 [Closed] System_Daemon::iterate problem &amp; fix</title>
      <link>http://pear.php.net/bugs/19121</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by cp
2011-12-10T09:01:17+00:00
PHP: 5.3.8 OS: CentOS Package Version: 1.0.0RC1

Description:
------------
Some users (like me) might use a large value for $sleepSeconds. This will cause usleep to throw a warning

Test script:
---------------
System_Daemon::iterate(3600)

/*This will not work and a warning will be logged:

warning: [PHP Warning] usleep(): Number of microseconds must be greater than or equal to 0

*/

Expected result:
----------------
A possible fix would be to change the following in Daemon.php:

self::_optionObjSetup();
if ($sleepSeconds !== 0) {
  usleep($sleepSeconds*1000000);
}

...to something like this:

self::_optionObjSetup();
if ($sleepSeconds !== 0) {
  if($sleepSeconds &gt; 2147) $sleepSeconds = 2147;
  usleep($sleepSeconds*1000000);
}</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by cp
2011-12-10T09:01:17+00:00
PHP: 5.3.8 OS: CentOS Package Version: 1.0.0RC1

Description:
------------
Some users (like me) might use a large value for $sleepSeconds. This will cause usleep to throw a warning

Test script:
---------------
System_Daemon::iterate(3600)

/*This will not work and a warning will be logged:

warning: [PHP Warning] usleep(): Number of microseconds must be greater than or equal to 0

*/

Expected result:
----------------
A possible fix would be to change the following in Daemon.php:

self::_optionObjSetup();
if ($sleepSeconds !== 0) {
  usleep($sleepSeconds*1000000);
}

...to something like this:

self::_optionObjSetup();
if ($sleepSeconds !== 0) {
  if($sleepSeconds &gt; 2147) $sleepSeconds = 2147;
  usleep($sleepSeconds*1000000);
}</pre>]]></description>
      <dc:date>2012-01-24T19:16:04+00:00</dc:date>
      <dc:creator>carlprinsloo &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/19101">
      <title>System_Daemon: Feature/Change Request 19101 [Closed] missing System_Daemon::alert() shortcut</title>
      <link>http://pear.php.net/bugs/19101</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by svanzoest
2011-12-06T05:59:43+00:00
PHP: 5.3.2 OS: Ubuntu 10.04.3 LTS Package Version: 1.0.0RC1

Description:
------------
There is a const for LOG_ALERT, but no corresponding function.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by svanzoest
2011-12-06T05:59:43+00:00
PHP: 5.3.2 OS: Ubuntu 10.04.3 LTS Package Version: 1.0.0RC1

Description:
------------
There is a const for LOG_ALERT, but no corresponding function.</pre>]]></description>
      <dc:date>2012-01-24T19:21:42+00:00</dc:date>
      <dc:creator>svanzoest &amp;#x61;&amp;#116; onerecovery &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18986">
      <title>System_Daemon: Bug 18986 [Bogus] Undefined index: class in Line 963</title>
      <link>http://pear.php.net/bugs/18986</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by mjb001
2011-11-14T20:17:15+00:00
PHP: 5.2.5 OS: Ubuntu Package Version: 1.0.0RC1

Description:
------------
Hello,

We registered an error handler and always got undefined index: class in the Daemon.php. We fixed it by changing the block around 963 to:

        $history  = 2;
        $dbg_bt   = @debug_backtrace();
        $class    = (isset($dbg_bt[($history-1)]['class'])?(string)@$dbg_bt[($history-1)]['class']:&quot;&quot;);
        $function = (isset($dbg_bt[($history-1)]['function'])?(string)@$dbg_bt[($history-1)]['function']:&quot;&quot;);
        $file     = (isset($dbg_bt[$history]['file'])?(string)@$dbg_bt[$history]['file']:&quot;&quot;);
        $line     = (isset($dbg_bt[$history]['line'])?(string)@$dbg_bt[$history]['line']:&quot;&quot;);
        return self::log($level, $str, $file, $class, $function, $line);</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by mjb001
2011-11-14T20:17:15+00:00
PHP: 5.2.5 OS: Ubuntu Package Version: 1.0.0RC1

Description:
------------
Hello,

We registered an error handler and always got undefined index: class in the Daemon.php. We fixed it by changing the block around 963 to:

        $history  = 2;
        $dbg_bt   = @debug_backtrace();
        $class    = (isset($dbg_bt[($history-1)]['class'])?(string)@$dbg_bt[($history-1)]['class']:&quot;&quot;);
        $function = (isset($dbg_bt[($history-1)]['function'])?(string)@$dbg_bt[($history-1)]['function']:&quot;&quot;);
        $file     = (isset($dbg_bt[$history]['file'])?(string)@$dbg_bt[$history]['file']:&quot;&quot;);
        $line     = (isset($dbg_bt[$history]['line'])?(string)@$dbg_bt[$history]['line']:&quot;&quot;);
        return self::log($level, $str, $file, $class, $function, $line);</pre>]]></description>
      <dc:date>2012-07-17T16:13:25+00:00</dc:date>
      <dc:creator>mjb &amp;#x61;&amp;#116; comnex &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18714">
      <title>System_Daemon: Feature/Change Request 18714 [Closed] Ability to log json string</title>
      <link>http://pear.php.net/bugs/18714</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by liang
2011-08-08T13:48:58+00:00
PHP: 5.3.6 OS: Mac OS X Snow Leopoard 10.6.0 Package Version: 1.0.0RC1

Description:
------------
In the current version of System_Daemon, there is no way to 
log a json string without being corrupted, because 
all strings like {XXX YYY ZZZ} will be replace by 
System_Daemon_Option::replaceVars to 
&quot;NONEXISTING_VAR_OPTIONS.XXX YYY ZZZ&quot;

for example:

$workload = json_encode(array('id' =&gt; 12345, 'name' =&gt; 
'test'));
System_Daemon::debug('got job: workload is: ' . workload)

expected output: 
   
    [Aug 08 14:25:14]    debug:  got job: workload is: {&quot;id&quot;: 
12345, &quot;name&quot;: &quot;test&quot;}


Actual output:

    [Aug 08 15:11:37]    debug: got job: workload is: 
NONEXISTING_VAR_OPTIONS.&quot;id&quot;:12345,&quot;name&quot;:&quot;test&quot;



Test script:
---------------
&lt;?php
require_once 'System/Daemon.php';

@mkdir(__DIR__ . '/test_daemon');

$options = array(
    'appName' =&gt; 'test_daemon',
    'appDescription' =&gt; 'a test daemon',
    'appDir'         =&gt; __DIR__,
    'authorName'     =&gt; 'LiANG ZHENJiNG',
    'authorEmail'    =&gt; 'liangzhenjing@gmail.com',
    'logLocation'    =&gt; '/dev/stdout',
    'logVerbosity'   =&gt; 7,
    'appPidLocation' =&gt; __DIR__ . '/test_daemon/test_daemon.pid',
);

System_Daemon::setOptions($options);
$workload = json_encode(array('id' =&gt; 12345, 'name' =&gt; 'test'));
System_Daemon::debug('got job: workload is: ' . $workload);


Expected result:
----------------
[Aug 08 14:25:14]    debug:  got job: workload is: {&quot;id&quot;: 12345, 
&quot;name&quot;: &quot;test&quot;}

Actual result:
--------------
[Aug 08 15:11:37]    debug: got job: workload is: 
NONEXISTING_VAR_OPTIONS.&quot;id&quot;:12345,&quot;name&quot;:&quot;test&quot;</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by liang
2011-08-08T13:48:58+00:00
PHP: 5.3.6 OS: Mac OS X Snow Leopoard 10.6.0 Package Version: 1.0.0RC1

Description:
------------
In the current version of System_Daemon, there is no way to 
log a json string without being corrupted, because 
all strings like {XXX YYY ZZZ} will be replace by 
System_Daemon_Option::replaceVars to 
&quot;NONEXISTING_VAR_OPTIONS.XXX YYY ZZZ&quot;

for example:

$workload = json_encode(array('id' =&gt; 12345, 'name' =&gt; 
'test'));
System_Daemon::debug('got job: workload is: ' . workload)

expected output: 
   
    [Aug 08 14:25:14]    debug:  got job: workload is: {&quot;id&quot;: 
12345, &quot;name&quot;: &quot;test&quot;}


Actual output:

    [Aug 08 15:11:37]    debug: got job: workload is: 
NONEXISTING_VAR_OPTIONS.&quot;id&quot;:12345,&quot;name&quot;:&quot;test&quot;



Test script:
---------------
&lt;?php
require_once 'System/Daemon.php';

@mkdir(__DIR__ . '/test_daemon');

$options = array(
    'appName' =&gt; 'test_daemon',
    'appDescription' =&gt; 'a test daemon',
    'appDir'         =&gt; __DIR__,
    'authorName'     =&gt; 'LiANG ZHENJiNG',
    'authorEmail'    =&gt; 'liangzhenjing@gmail.com',
    'logLocation'    =&gt; '/dev/stdout',
    'logVerbosity'   =&gt; 7,
    'appPidLocation' =&gt; __DIR__ . '/test_daemon/test_daemon.pid',
);

System_Daemon::setOptions($options);
$workload = json_encode(array('id' =&gt; 12345, 'name' =&gt; 'test'));
System_Daemon::debug('got job: workload is: ' . $workload);


Expected result:
----------------
[Aug 08 14:25:14]    debug:  got job: workload is: {&quot;id&quot;: 12345, 
&quot;name&quot;: &quot;test&quot;}

Actual result:
--------------
[Aug 08 15:11:37]    debug: got job: workload is: 
NONEXISTING_VAR_OPTIONS.&quot;id&quot;:12345,&quot;name&quot;:&quot;test&quot;</pre>]]></description>
      <dc:date>2012-01-24T19:45:37+00:00</dc:date>
      <dc:creator>liangzhenjing &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18677">
      <title>System_Daemon: Bug 18677 [Closed] System_Daemon_OS::factory() called statically</title>
      <link>http://pear.php.net/bugs/18677</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by adnam
2011-07-21T14:55:25+00:00
PHP: 5.3.1 OS: Linux 2.6.35-30-generic-pae Package Version: 1.0.0RC1

Description:
------------
The factory method System_Daemon_OS::factory() is defined non-statically thus:

[System/Daemon/OS.php line 100]
public function &amp;factory($force_os = false, $retried = false)
{
    /* .... */
}

It is called in System_Daemon::_osObjSetup() statically, like this:

[System/Daemon.php line 1584]
        if (!self::$_osObj) {
            self::$_osObj = System_Daemon_OS::factory();
        }

System_Daemon_OS::factory() also contains a reference to $this at line 120.

It first needs to be decided if the method should be called statically or non-statically in order to fix this programming error. If defined statically, it should not reference $this; whereas if left as-is, System_Daemon should create a System_Daemon_OS instance and call the factory something method like this:

        if (!self::$_osObj) {
            $os = new System_Daemon_OS();
            self::$_osObj = $os-&gt;factory();
        }

However, according to the doc-comments, System_Daemon_OS::__construct() can &quot;[only be run] by instantiated OS Drivers&quot;.

Regards,

Adam Hayward

Test script:
---------------
No test script to report

Expected result:
----------------
No expected result to report.

Actual result:
--------------
No result to report.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by adnam
2011-07-21T14:55:25+00:00
PHP: 5.3.1 OS: Linux 2.6.35-30-generic-pae Package Version: 1.0.0RC1

Description:
------------
The factory method System_Daemon_OS::factory() is defined non-statically thus:

[System/Daemon/OS.php line 100]
public function &amp;factory($force_os = false, $retried = false)
{
    /* .... */
}

It is called in System_Daemon::_osObjSetup() statically, like this:

[System/Daemon.php line 1584]
        if (!self::$_osObj) {
            self::$_osObj = System_Daemon_OS::factory();
        }

System_Daemon_OS::factory() also contains a reference to $this at line 120.

It first needs to be decided if the method should be called statically or non-statically in order to fix this programming error. If defined statically, it should not reference $this; whereas if left as-is, System_Daemon should create a System_Daemon_OS instance and call the factory something method like this:

        if (!self::$_osObj) {
            $os = new System_Daemon_OS();
            self::$_osObj = $os-&gt;factory();
        }

However, according to the doc-comments, System_Daemon_OS::__construct() can &quot;[only be run] by instantiated OS Drivers&quot;.

Regards,

Adam Hayward

Test script:
---------------
No test script to report

Expected result:
----------------
No expected result to report.

Actual result:
--------------
No result to report.</pre>]]></description>
      <dc:date>2012-01-24T19:44:44+00:00</dc:date>
      <dc:creator>adam &amp;#x61;&amp;#116; happy &amp;#x64;&amp;#111;&amp;#x74; cat</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18659">
      <title>System_Daemon: Bug 18659 [Closed] Fatal error during initial run</title>
      <link>http://pear.php.net/bugs/18659</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by pietux
2011-07-11T03:36:54+00:00
PHP: 5.2.10 OS: centos 5, 64-bit Package Version: 1.0.0RC1

Description:
------------
While running the daemon script initially with --write-initd, I encounter fatal php 
error in theline which calls setOption() 

I installed the System_Daemon package via pear. This error occurrecd
Then uninstalled from the pear, downloaded from the git repo, and included 
the Daemon.php from its extracted location. Same error still.

I have about a year older version up and running on this same server.

Test script:
---------------
setOption('appRunAsGID', 0); // set to root 

Expected result:
----------------
sucessfully written startup script: %s

Actual result:
--------------
# PHP Fatal error:  Call to undefined function setOption() in 
/data/connections/sms_sender_daemon.php on line 121</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by pietux
2011-07-11T03:36:54+00:00
PHP: 5.2.10 OS: centos 5, 64-bit Package Version: 1.0.0RC1

Description:
------------
While running the daemon script initially with --write-initd, I encounter fatal php 
error in theline which calls setOption() 

I installed the System_Daemon package via pear. This error occurrecd
Then uninstalled from the pear, downloaded from the git repo, and included 
the Daemon.php from its extracted location. Same error still.

I have about a year older version up and running on this same server.

Test script:
---------------
setOption('appRunAsGID', 0); // set to root 

Expected result:
----------------
sucessfully written startup script: %s

Actual result:
--------------
# PHP Fatal error:  Call to undefined function setOption() in 
/data/connections/sms_sender_daemon.php on line 121</pre>]]></description>
      <dc:date>2011-07-11T04:18:37+00:00</dc:date>
      <dc:creator>petri &amp;#x64;&amp;#111;&amp;#x74; laihonen &amp;#x61;&amp;#116; waponelineusa &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18606">
      <title>System_Daemon: Bug 18606 [Closed] setOption</title>
      <link>http://pear.php.net/bugs/18606</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by diemuzi
2011-06-18T03:10:19+00:00
PHP: 5.3.6 OS: NA Package Version: 1.0.0RC1

Description:
------------
    public function setOption($name, $value)
    {
        $success = true;
        // Not validated?
        if (!$this-&gt;_validate($name, $value, $reason)) {
            // Default not used or failed as well!
            $this-&gt;errors[] = &quot;Option &quot;.$name.&quot; invalid: &quot;.$reason;
            $success        = false;
        }
        
        $this-&gt;_options[$name] = $value;
        return $success;
    }

Expected result:
----------------
From what I can understand the $reason variable cannot be set when calling setOption. This variable appears to be an undefined var. I see in the _validate() function $reason is set but setOption has no configuration for it</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by diemuzi
2011-06-18T03:10:19+00:00
PHP: 5.3.6 OS: NA Package Version: 1.0.0RC1

Description:
------------
    public function setOption($name, $value)
    {
        $success = true;
        // Not validated?
        if (!$this-&gt;_validate($name, $value, $reason)) {
            // Default not used or failed as well!
            $this-&gt;errors[] = &quot;Option &quot;.$name.&quot; invalid: &quot;.$reason;
            $success        = false;
        }
        
        $this-&gt;_options[$name] = $value;
        return $success;
    }

Expected result:
----------------
From what I can understand the $reason variable cannot be set when calling setOption. This variable appears to be an undefined var. I see in the _validate() function $reason is set but setOption has no configuration for it</pre>]]></description>
      <dc:date>2011-06-20T17:10:31+00:00</dc:date>
      <dc:creator>diemuzi &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18561">
      <title>System_Daemon: Bug 18561 [Closed] _ilog function incompatible with json_encode output</title>
      <link>http://pear.php.net/bugs/18561</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by svanzoest
2011-05-25T04:38:31+00:00
PHP: 5.3.6 OS: Ubuntu Lucid Package Version: 1.0.0RC1

Description:
------------
Because of the internal {AppName} preg_replace_callback() in the _ilog function, we are unable to output a json string.



Test script:
---------------
For example:

System_Daemon::notice(&quot;update %s -&gt; %s&quot;, $uuid, json_encode($string));

Expected result:
----------------
 notice:  update '64a6c2bc8799441db69ab9909d7477dd' -&gt; '{&quot;name&quot;:0}'




Actual result:
--------------
 notice:  update '64a6c2bc8799441db69ab9909d7477dd' -&gt; 'NONEXISTING_VAR_OPTIONS.&quot;name&quot;:0</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by svanzoest
2011-05-25T04:38:31+00:00
PHP: 5.3.6 OS: Ubuntu Lucid Package Version: 1.0.0RC1

Description:
------------
Because of the internal {AppName} preg_replace_callback() in the _ilog function, we are unable to output a json string.



Test script:
---------------
For example:

System_Daemon::notice(&quot;update %s -&gt; %s&quot;, $uuid, json_encode($string));

Expected result:
----------------
 notice:  update '64a6c2bc8799441db69ab9909d7477dd' -&gt; '{&quot;name&quot;:0}'




Actual result:
--------------
 notice:  update '64a6c2bc8799441db69ab9909d7477dd' -&gt; 'NONEXISTING_VAR_OPTIONS.&quot;name&quot;:0</pre>]]></description>
      <dc:date>2011-05-25T14:38:24+00:00</dc:date>
      <dc:creator>svanzoest &amp;#x61;&amp;#116; onerecovery &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18394">
      <title>System_Daemon: Bug 18394 [Bogus] service app_name status reporting wrong</title>
      <link>http://pear.php.net/bugs/18394</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by zombiitv
2011-03-24T11:28:50+00:00
PHP: 5.3.5 OS: Centos 5.5 Package Version: 1.0.0RC1

Description:
------------
I was successful in writing an init.d file and it works great when I use start, stop and restart; however it is not reporting running when it is running and I enter service app_name status.

Does my file name need to be the same as the app name?

Test script:
---------------
root /etc/init.d # ps uf -C posts.php
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     22724  1.0  0.5 1314896 41588 pts/1   S    02:20   0:00 /usr/bin/php -c /etc/php.ini? /post.php
root /etc/init.d # service posts status
posts is stopped</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by zombiitv
2011-03-24T11:28:50+00:00
PHP: 5.3.5 OS: Centos 5.5 Package Version: 1.0.0RC1

Description:
------------
I was successful in writing an init.d file and it works great when I use start, stop and restart; however it is not reporting running when it is running and I enter service app_name status.

Does my file name need to be the same as the app name?

Test script:
---------------
root /etc/init.d # ps uf -C posts.php
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     22724  1.0  0.5 1314896 41588 pts/1   S    02:20   0:00 /usr/bin/php -c /etc/php.ini? /post.php
root /etc/init.d # service posts status
posts is stopped</pre>]]></description>
      <dc:date>2012-07-17T16:14:17+00:00</dc:date>
      <dc:creator>zombiitv &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18380">
      <title>System_Daemon: Bug 18380 [Bogus] Options error</title>
      <link>http://pear.php.net/bugs/18380</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by zombiitv
2011-03-21T09:33:10+00:00
PHP: 5.3.5 OS: Centos 5.5 Package Version: 1.0.0RC1

Description:
------------
'logVerbosity' requires a type in the Daemon class however, I was not able to get the daemon to start when I used a number, I ended up using this:

'logVerbosity' =&gt; System_daemon::LOG_DEBUG</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by zombiitv
2011-03-21T09:33:10+00:00
PHP: 5.3.5 OS: Centos 5.5 Package Version: 1.0.0RC1

Description:
------------
'logVerbosity' requires a type in the Daemon class however, I was not able to get the daemon to start when I used a number, I ended up using this:

'logVerbosity' =&gt; System_daemon::LOG_DEBUG</pre>]]></description>
      <dc:date>2012-07-17T16:14:15+00:00</dc:date>
      <dc:creator>zombiitv &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18087">
      <title>System_Daemon: Feature/Change Request 18087 [Closed] Use $this-&gt; instead of self::</title>
      <link>http://pear.php.net/bugs/18087</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by q0rban
2010-11-30T01:26:46+00:00
PHP: 5.2.12 OS: Mac OS 10.6 Package Version: 0.10.3

Description:
------------
This is great stuff, thanks so much for working on it! Currently 
it's cumbersome to extend this class though, since everything is 
using self:: instead of $this. Is there a reason it's done this way?

Thanks again.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by q0rban
2010-11-30T01:26:46+00:00
PHP: 5.2.12 OS: Mac OS 10.6 Package Version: 0.10.3

Description:
------------
This is great stuff, thanks so much for working on it! Currently 
it's cumbersome to extend this class though, since everything is 
using self:: instead of $this. Is there a reason it's done this way?

Thanks again.</pre>]]></description>
      <dc:date>2010-12-02T16:40:12+00:00</dc:date>
      <dc:creator>jsansbury &amp;#x61;&amp;#116; lullabot &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18071">
      <title>System_Daemon: Feature/Change Request 18071 [Closed] Show line/file position when using pear log instance</title>
      <link>http://pear.php.net/bugs/18071</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by yousan
2010-11-18T16:45:06+00:00
PHP: 5.3.3 OS: FreeBSD 8.1-R Package Version: 0.10.3

Description:
------------
Hello.

I use PEAR::Log instance to log out through syslog.
And also I use logLinePosition and logFilePosition options to check out errors.
Now the daemon does not put the line/file information to PEAR::Log instance.
I want to put them out.

Test script:
---------------
require_once('System/Daemon.php');
require_once('Log.php');
$log = Log::singleton('syslog', 'LOG_USER', 'test');
System_Daemon::setOption(&quot;appName&quot;, 'test');
System_Daemon::setOption('logFilePosition', true);
System_Daemon::setOption('logLinePosition', true);
System_Daemon::setOption('usePEARLogInstance', $log);
System_Daemon::start();
usleep('hogehoge');
System_Daemon::stop();


Expected result:
----------------
Nov 18 19:38:10 tyler test[16649]: [PHP Error] usleep() expects parameter 1 to be long, string given [f:/syst
em.php] [l:11]


Actual result:
--------------
Nov 18 19:38:10 tyler test[16649]: [PHP Error] usleep() expects parameter 1 to be long, string given</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by yousan
2010-11-18T16:45:06+00:00
PHP: 5.3.3 OS: FreeBSD 8.1-R Package Version: 0.10.3

Description:
------------
Hello.

I use PEAR::Log instance to log out through syslog.
And also I use logLinePosition and logFilePosition options to check out errors.
Now the daemon does not put the line/file information to PEAR::Log instance.
I want to put them out.

Test script:
---------------
require_once('System/Daemon.php');
require_once('Log.php');
$log = Log::singleton('syslog', 'LOG_USER', 'test');
System_Daemon::setOption(&quot;appName&quot;, 'test');
System_Daemon::setOption('logFilePosition', true);
System_Daemon::setOption('logLinePosition', true);
System_Daemon::setOption('usePEARLogInstance', $log);
System_Daemon::start();
usleep('hogehoge');
System_Daemon::stop();


Expected result:
----------------
Nov 18 19:38:10 tyler test[16649]: [PHP Error] usleep() expects parameter 1 to be long, string given [f:/syst
em.php] [l:11]


Actual result:
--------------
Nov 18 19:38:10 tyler test[16649]: [PHP Error] usleep() expects parameter 1 to be long, string given</pre>]]></description>
      <dc:date>2010-12-05T20:15:55+00:00</dc:date>
      <dc:creator>yousan &amp;#x61;&amp;#116; l2tp &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18070">
      <title>System_Daemon: Feature/Change Request 18070 [Closed] Show a type of php error.</title>
      <link>http://pear.php.net/bugs/18070</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by yousan
2010-11-18T16:17:13+00:00
PHP: 5.3.3 OS: FreeBSD 8.1-R Package Version: 0.10.3

Description:
------------
When a php error happens, the daemon logs it as &quot;[PHP Error]&quot; message.
I want to divide the problems what problem stops the daemon. I need *real* error message.
If i can see the PHP error is real error or warning, then I can passthru many warnings.


I appreciate this System_Daemon package. This helps me, and makes me happy.

Test script:
---------------
require_once('System/Daemon.php');
require_once('Log.php');
 $log = Log::singleton('syslog', 'LOG_USER', 'test');
System_Daemon::setOption(&quot;appName&quot;, 'test');
System_Daemon::setOption('logFilePosition', true);
System_Daemon::setOption('usePEARLogInstance', $log);
System_Daemon::start();
usleep('hogehoge');


Actual result:
--------------
Nov 18 19:02:44 tyler test[16445]: [PHP Warning] usleep() expects parameter 1 to be long, string given</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by yousan
2010-11-18T16:17:13+00:00
PHP: 5.3.3 OS: FreeBSD 8.1-R Package Version: 0.10.3

Description:
------------
When a php error happens, the daemon logs it as &quot;[PHP Error]&quot; message.
I want to divide the problems what problem stops the daemon. I need *real* error message.
If i can see the PHP error is real error or warning, then I can passthru many warnings.


I appreciate this System_Daemon package. This helps me, and makes me happy.

Test script:
---------------
require_once('System/Daemon.php');
require_once('Log.php');
 $log = Log::singleton('syslog', 'LOG_USER', 'test');
System_Daemon::setOption(&quot;appName&quot;, 'test');
System_Daemon::setOption('logFilePosition', true);
System_Daemon::setOption('usePEARLogInstance', $log);
System_Daemon::start();
usleep('hogehoge');


Actual result:
--------------
Nov 18 19:02:44 tyler test[16445]: [PHP Warning] usleep() expects parameter 1 to be long, string given</pre>]]></description>
      <dc:date>2010-12-05T20:09:43+00:00</dc:date>
      <dc:creator>yousan &amp;#x61;&amp;#116; l2tp &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18069">
      <title>System_Daemon: Bug 18069 [Bogus] err: Unable to change group of file '/var/run/sboardtoold' to 1000 [l:1425]</title>
      <link>http://pear.php.net/bugs/18069</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by werkhovent
2010-11-17T23:58:51+00:00
PHP: 5.2.5 OS: CentOS Package Version: 0.10.3

Description:
------------
We currently use System_Daemon to start a daemon on the command shell. This works perfect.

Is it possible to start this daemon from within a web page? We see a &quot;unable to change group of file&quot; error in the System_Daemon log.

Any idea what we are doing wrong?

Thanks!
Tom</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by werkhovent
2010-11-17T23:58:51+00:00
PHP: 5.2.5 OS: CentOS Package Version: 0.10.3

Description:
------------
We currently use System_Daemon to start a daemon on the command shell. This works perfect.

Is it possible to start this daemon from within a web page? We see a &quot;unable to change group of file&quot; error in the System_Daemon log.

Any idea what we are doing wrong?

Thanks!
Tom</pre>]]></description>
      <dc:date>2012-07-17T16:14:13+00:00</dc:date>
      <dc:creator>tom &amp;#x61;&amp;#116; tailormadesoftware &amp;#x64;&amp;#111;&amp;#x74; be</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18054">
      <title>System_Daemon: Bug 18054 [Bogus] Couldnt create pid-file</title>
      <link>http://pear.php.net/bugs/18054</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by webcf
2010-11-14T20:11:44+00:00
PHP: 5.2.6 OS: Debian lenny Package Version: 0.10.3

Description:
------------
Hey, I've set up my daemon but i get the following error:

[Nov 14 15:04:23]   notice: Starting PHPMeteo daemon, output in: '/etc/phpm/messages.log'
[Nov 14 15:04:23]      err: Since version 0.6.3, the pidfile needs to be in it's own subdirectory like: %s/PHPMeteo/PHPMeteo.pid [l:1339]
[Nov 14 15:04:23]    emerg: Unable to write pid file /etc/phpm/PHPMeteo [l:1272]


Config:


$options = array(
    &quot;authorName&quot;                    =&gt; &quot;PHPMeteo&quot;,
    &quot;authorEmail&quot;                   =&gt; &quot;no-reply@webcf.de&quot;,
    &quot;appName&quot;                       =&gt; &quot;PHPMeteo&quot;,
    &quot;appDescription&quot;                =&gt; &quot;Daemon which logs weather data from stations&quot;,
    &quot;usePEAR&quot;                       =&gt; false,
    &quot;appDir&quot;                        =&gt; dirname(__FILE__),
    &quot;logLocation&quot;                   =&gt; dirname(__FILE__).&quot;/messages.log&quot;,
    &quot;appPidLocation&quot;                =&gt; dirname(__FILE__).&quot;/PHPMeteo&quot;,
    &quot;appRunAsUID&quot;                   =&gt; &quot;1000&quot;,
    &quot;appRunAsGID&quot;                   =&gt; &quot;1000&quot;
);

Some ideas? I've tried several piddir locations...</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by webcf
2010-11-14T20:11:44+00:00
PHP: 5.2.6 OS: Debian lenny Package Version: 0.10.3

Description:
------------
Hey, I've set up my daemon but i get the following error:

[Nov 14 15:04:23]   notice: Starting PHPMeteo daemon, output in: '/etc/phpm/messages.log'
[Nov 14 15:04:23]      err: Since version 0.6.3, the pidfile needs to be in it's own subdirectory like: %s/PHPMeteo/PHPMeteo.pid [l:1339]
[Nov 14 15:04:23]    emerg: Unable to write pid file /etc/phpm/PHPMeteo [l:1272]


Config:


$options = array(
    &quot;authorName&quot;                    =&gt; &quot;PHPMeteo&quot;,
    &quot;authorEmail&quot;                   =&gt; &quot;no-reply@webcf.de&quot;,
    &quot;appName&quot;                       =&gt; &quot;PHPMeteo&quot;,
    &quot;appDescription&quot;                =&gt; &quot;Daemon which logs weather data from stations&quot;,
    &quot;usePEAR&quot;                       =&gt; false,
    &quot;appDir&quot;                        =&gt; dirname(__FILE__),
    &quot;logLocation&quot;                   =&gt; dirname(__FILE__).&quot;/messages.log&quot;,
    &quot;appPidLocation&quot;                =&gt; dirname(__FILE__).&quot;/PHPMeteo&quot;,
    &quot;appRunAsUID&quot;                   =&gt; &quot;1000&quot;,
    &quot;appRunAsGID&quot;                   =&gt; &quot;1000&quot;
);

Some ideas? I've tried several piddir locations...</pre>]]></description>
      <dc:date>2010-11-14T20:50:21+00:00</dc:date>
      <dc:creator>commi1993 &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18036">
      <title>System_Daemon: Bug 18036 [Closed] Memleak in System_Daemon::info()</title>
      <link>http://pear.php.net/bugs/18036</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by kkszysiu
2010-11-09T17:02:57+00:00
PHP: 5.2.6 OS: Linux Package Version: 0.10.3

Description:
------------
Hello.
I'm using System_Daemon to demonise our php scipts but we're suffering on regular crashes caused by PHP fatals - &quot;Allowed memory size of 134217728 bytes exhausted (tried to allocate 1572868 bytes)&quot;. I checked that using simple script attached do that bug report and it seems that your logging functions are fault of that memleak.

More about it: http://stackoverflow.com/questions/4113776/php-daemon-possible-memory-leak/4125427#4125427

Test script:
---------------
#!/usr/bin/php -q

&lt;?php
require_once &quot;System/Daemon.php&quot;;
System_Daemon::setOption(&quot;appName&quot;, &quot;smsd&quot;);
System_Daemon::start();
while(!System_Daemon::isDying()) {
System_Daemon::info(&quot;debug: memory_get_peak_usage: &quot;.memory_get_peak_usage().&quot;\n&quot;);
System_Daemon::info(&quot;debug: memory_get_usage: &quot;.memory_get_usage().&quot;\n\n&quot;);
 System_Daemon::iterate(2);

}


Expected result:
----------------
Well, memory_get_peak_usage should not growing. When we use &quot;print&quot; function from PHP it works well but with System_Daemon::info() memory usage is growing fast.

Actual result:
--------------
[Nov 08 16:46:00]     info: debug: memory_get_peak_usage: 999304
[Nov 08 16:46:00]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:02]     info: debug: memory_get_peak_usage: 999400
[Nov 08 16:46:02]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:04]     info: debug: memory_get_peak_usage: 999496
[Nov 08 16:46:04]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:06]     info: debug: memory_get_peak_usage: 999592
[Nov 08 16:46:06]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:08]     info: debug: memory_get_peak_usage: 999688
[Nov 08 16:46:08]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:10]     info: debug: memory_get_peak_usage: 999784
[Nov 08 16:46:10]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:12]     info: debug: memory_get_peak_usage: 999880
[Nov 08 16:46:12]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:14]     info: debug: memory_get_peak_usage: 999976
[Nov 08 16:46:14]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:16]     info: debug: memory_get_peak_usage: 1000072
[Nov 08 16:46:16]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:18]     info: debug: memory_get_peak_usage: 1000168
[Nov 08 16:46:18]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:20]     info: debug: memory_get_peak_usage: 1000264
[Nov 08 16:46:20]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:22]     info: debug: memory_get_peak_usage: 1000360
[Nov 08 16:46:22]     info: debug: memory_get_usage: 934564
(...)</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by kkszysiu
2010-11-09T17:02:57+00:00
PHP: 5.2.6 OS: Linux Package Version: 0.10.3

Description:
------------
Hello.
I'm using System_Daemon to demonise our php scipts but we're suffering on regular crashes caused by PHP fatals - &quot;Allowed memory size of 134217728 bytes exhausted (tried to allocate 1572868 bytes)&quot;. I checked that using simple script attached do that bug report and it seems that your logging functions are fault of that memleak.

More about it: http://stackoverflow.com/questions/4113776/php-daemon-possible-memory-leak/4125427#4125427

Test script:
---------------
#!/usr/bin/php -q

&lt;?php
require_once &quot;System/Daemon.php&quot;;
System_Daemon::setOption(&quot;appName&quot;, &quot;smsd&quot;);
System_Daemon::start();
while(!System_Daemon::isDying()) {
System_Daemon::info(&quot;debug: memory_get_peak_usage: &quot;.memory_get_peak_usage().&quot;\n&quot;);
System_Daemon::info(&quot;debug: memory_get_usage: &quot;.memory_get_usage().&quot;\n\n&quot;);
 System_Daemon::iterate(2);

}


Expected result:
----------------
Well, memory_get_peak_usage should not growing. When we use &quot;print&quot; function from PHP it works well but with System_Daemon::info() memory usage is growing fast.

Actual result:
--------------
[Nov 08 16:46:00]     info: debug: memory_get_peak_usage: 999304
[Nov 08 16:46:00]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:02]     info: debug: memory_get_peak_usage: 999400
[Nov 08 16:46:02]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:04]     info: debug: memory_get_peak_usage: 999496
[Nov 08 16:46:04]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:06]     info: debug: memory_get_peak_usage: 999592
[Nov 08 16:46:06]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:08]     info: debug: memory_get_peak_usage: 999688
[Nov 08 16:46:08]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:10]     info: debug: memory_get_peak_usage: 999784
[Nov 08 16:46:10]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:12]     info: debug: memory_get_peak_usage: 999880
[Nov 08 16:46:12]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:14]     info: debug: memory_get_peak_usage: 999976
[Nov 08 16:46:14]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:16]     info: debug: memory_get_peak_usage: 1000072
[Nov 08 16:46:16]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:18]     info: debug: memory_get_peak_usage: 1000168
[Nov 08 16:46:18]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:20]     info: debug: memory_get_peak_usage: 1000264
[Nov 08 16:46:20]     info: debug: memory_get_usage: 934564
[Nov 08 16:46:22]     info: debug: memory_get_peak_usage: 1000360
[Nov 08 16:46:22]     info: debug: memory_get_usage: 934564
(...)</pre>]]></description>
      <dc:date>2010-11-09T17:11:44+00:00</dc:date>
      <dc:creator>kkszysiu &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17919">
      <title>System_Daemon: Bug 17919 [Closed] Crashes after 3 days</title>
      <link>http://pear.php.net/bugs/17919</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by dragon001
2010-09-30T20:19:12+00:00
PHP: 5.2.1 OS: Debian Linux 5.0 Package Version: 

Description:
------------
Well I have the script running.
It is based on your samples.
Everything works fine, but the daemon dies after 17 - 48 
hours.
I have some tasks running ones an hour.
Additionally some tasks run once a day/Week/Month.
The Main Script that schedules these runs works fine.
I don't get any error messages at all.
I don't even have a crash note inside my system log.
it just dies silently.
In the time the script is running it works perfectly without any 
limitations.
I don't know how I should find out why the script dies.
Please Help me.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by dragon001
2010-09-30T20:19:12+00:00
PHP: 5.2.1 OS: Debian Linux 5.0 Package Version: 

Description:
------------
Well I have the script running.
It is based on your samples.
Everything works fine, but the daemon dies after 17 - 48 
hours.
I have some tasks running ones an hour.
Additionally some tasks run once a day/Week/Month.
The Main Script that schedules these runs works fine.
I don't get any error messages at all.
I don't even have a crash note inside my system log.
it just dies silently.
In the time the script is running it works perfectly without any 
limitations.
I don't know how I should find out why the script dies.
Please Help me.</pre>]]></description>
      <dc:date>2010-09-30T20:49:22+00:00</dc:date>
      <dc:creator>chris &amp;#x61;&amp;#116; westerfield &amp;#x64;&amp;#111;&amp;#x74; name</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17917">
      <title>System_Daemon: Bug 17917 [Bogus] UID and GID passed as string causes problem</title>
      <link>http://pear.php.net/bugs/17917</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by kami
2010-09-30T16:31:25+00:00
PHP: 5.2.6 OS: Debian GNU/Linux 5.0.6 Package Version: SVN

Description:
------------
I read the UID GUI for the daemon from a config file. Maybe the daemon should convert them into integer automatically. Currently If I pass a string to &quot;appRunAsGID&quot; &quot;appRunAsUID&quot; I got error - not possble set group permissions for pid.
Can you cast (int) these variables before processing?

Thanks,
KAMI</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by kami
2010-09-30T16:31:25+00:00
PHP: 5.2.6 OS: Debian GNU/Linux 5.0.6 Package Version: SVN

Description:
------------
I read the UID GUI for the daemon from a config file. Maybe the daemon should convert them into integer automatically. Currently If I pass a string to &quot;appRunAsGID&quot; &quot;appRunAsUID&quot; I got error - not possble set group permissions for pid.
Can you cast (int) these variables before processing?

Thanks,
KAMI</pre>]]></description>
      <dc:date>2012-07-17T16:14:11+00:00</dc:date>
      <dc:creator>kami911 &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17916">
      <title>System_Daemon: Feature/Change Request 17916 [Wont fix] UID and GID passed as string causes problem</title>
      <link>http://pear.php.net/bugs/17916</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by kami
2010-09-30T16:25:35+00:00
PHP: 5.2.6 OS: Debian GNU/Linux 5.0.6 Package Version: SVN

Description:
------------
I read the UID GUI for the daemon from a config file. Maybe the daemon should convert them into integer automatically. Currently If I pass a string to &quot;appRunAsGID&quot; &quot;appRunAsUID&quot; I got error - not possble set group permissions for pid.
Can you cast (int) these variables before processing?

Thanks,
KAMI</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by kami
2010-09-30T16:25:35+00:00
PHP: 5.2.6 OS: Debian GNU/Linux 5.0.6 Package Version: SVN

Description:
------------
I read the UID GUI for the daemon from a config file. Maybe the daemon should convert them into integer automatically. Currently If I pass a string to &quot;appRunAsGID&quot; &quot;appRunAsUID&quot; I got error - not possble set group permissions for pid.
Can you cast (int) these variables before processing?

Thanks,
KAMI</pre>]]></description>
      <dc:date>2012-07-17T16:14:09+00:00</dc:date>
      <dc:creator>kami911 &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17634">
      <title>System_Daemon: Bug 17634 [Bogus] System_Daemon script couldn't daemonize on Zend Server platform</title>
      <link>http://pear.php.net/bugs/17634</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by gergund
2010-07-27T16:37:17+00:00
PHP: 5.3.2 OS: CentOS 5.5 x86_64 Package Version: 0.10.3

Description:
------------
System_Daemon script couldn't daemonize on Zend Server platform</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by gergund
2010-07-27T16:37:17+00:00
PHP: 5.3.2 OS: CentOS 5.5 x86_64 Package Version: 0.10.3

Description:
------------
System_Daemon script couldn't daemonize on Zend Server platform</pre>]]></description>
      <dc:date>2012-07-17T16:14:06+00:00</dc:date>
      <dc:creator>gergund &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17600">
      <title>System_Daemon: Feature/Change Request 17600 [Closed] Changing of homedirectory</title>
      <link>http://pear.php.net/bugs/17600</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by jastorm
2010-07-15T23:59:40+00:00
PHP: 5.3.2 OS: Linux Package Version: 0.10.3

Description:
------------
(Lets for testings sake say that username for UID 1001 is whatever).

When setting appRunAsUID/GID I kinda expect it to use the homedir of that UID, instead it uses /root and therefore in some cases cause errors due to file/catalogstructure permissions.

I solve it by doing system(&quot;export HOME=\&quot;/home/whatever\&quot;  where needed. Though I feel that it should be a option/feature included in the code.

Test script:
---------------
'appRunAsGID' =&gt; 1001,
'appRunAsUID' =&gt; 1001,

Expected result:
----------------
/home/whatever/

Actual result:
--------------
/root/</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by jastorm
2010-07-15T23:59:40+00:00
PHP: 5.3.2 OS: Linux Package Version: 0.10.3

Description:
------------
(Lets for testings sake say that username for UID 1001 is whatever).

When setting appRunAsUID/GID I kinda expect it to use the homedir of that UID, instead it uses /root and therefore in some cases cause errors due to file/catalogstructure permissions.

I solve it by doing system(&quot;export HOME=\&quot;/home/whatever\&quot;  where needed. Though I feel that it should be a option/feature included in the code.

Test script:
---------------
'appRunAsGID' =&gt; 1001,
'appRunAsUID' =&gt; 1001,

Expected result:
----------------
/home/whatever/

Actual result:
--------------
/root/</pre>]]></description>
      <dc:date>2010-07-18T14:41:14+00:00</dc:date>
      <dc:creator>jastor &amp;#x61;&amp;#116; lazypirate &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17593">
      <title>System_Daemon: Bug 17593 [Bogus] If I put the daemon call inside a class, its destructor gets called</title>
      <link>http://pear.php.net/bugs/17593</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by sabya
2010-07-14T19:15:07+00:00
PHP: 5.2.9 OS: Red Hat Enterprise Linux Server Package Version: 0.10.3

Description:
------------
I have kept the System_Daemon::start() call inside a PHP class. 
Now I am creating an object of 
that class and calling a method of it.

When the System_Daemon::start() function gets called, the 
destructor also gets executed! Why?

Expected result:
----------------
The execution of the destructor is unexpected.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by sabya
2010-07-14T19:15:07+00:00
PHP: 5.2.9 OS: Red Hat Enterprise Linux Server Package Version: 0.10.3

Description:
------------
I have kept the System_Daemon::start() call inside a PHP class. 
Now I am creating an object of 
that class and calling a method of it.

When the System_Daemon::start() function gets called, the 
destructor also gets executed! Why?

Expected result:
----------------
The execution of the destructor is unexpected.</pre>]]></description>
      <dc:date>2012-07-17T16:14:02+00:00</dc:date>
      <dc:creator>ruj &amp;#x64;&amp;#111;&amp;#x74; sabya &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17426">
      <title>System_Daemon: Bug 17426 [Duplicate] Undefined Indexes</title>
      <link>http://pear.php.net/bugs/17426</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by elyobo
2010-05-22T15:04:47+00:00
PHP: 5.2.6 OS: Linux Package Version: 0.10.3

Description:
------------
Some warnings are being generated about undefined indexes.  We generally develop with a custom error handler which transforms errors into Exceptions, so this is particularly annoying.

This can easily be fixed by checking if the key exists before accessing it, e.g. in System/Daemon.php on line 951

$class    = (string)@$dbg_bt[($history-1)]['class'];

becomes

 $class    = (string)array_key_exists('class', $dbg_bt[($history-1)]) ? $dbg_bt[($history-1)]['class'] : '';



Expected result:
----------------
I don't expect indexes which don't exist to be accessed.

Actual result:
--------------
Invalid indexes are accessed, rather than checking correctly before access.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by elyobo
2010-05-22T15:04:47+00:00
PHP: 5.2.6 OS: Linux Package Version: 0.10.3

Description:
------------
Some warnings are being generated about undefined indexes.  We generally develop with a custom error handler which transforms errors into Exceptions, so this is particularly annoying.

This can easily be fixed by checking if the key exists before accessing it, e.g. in System/Daemon.php on line 951

$class    = (string)@$dbg_bt[($history-1)]['class'];

becomes

 $class    = (string)array_key_exists('class', $dbg_bt[($history-1)]) ? $dbg_bt[($history-1)]['class'] : '';



Expected result:
----------------
I don't expect indexes which don't exist to be accessed.

Actual result:
--------------
Invalid indexes are accessed, rather than checking correctly before access.</pre>]]></description>
      <dc:date>2010-05-22T15:58:37+00:00</dc:date>
      <dc:creator>liam &amp;#x64;&amp;#111;&amp;#x74; oboyle &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17419">
      <title>System_Daemon: Bug 17419 [Closed] Non-static method System_Daemon::semantify() should not be called statically</title>
      <link>http://pear.php.net/bugs/17419</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by njcalugar
2010-05-20T21:36:35+00:00
PHP: 5.3.2 OS: Mac OS X 10.5 Package Version: 0.10.3

Description:
------------
With error_reporting = E_ALL | E_STRICT:

Strict Standards: Non-static method System_Daemon::semantify() should not be called statically in /usr/local/zend/share/pear/System/Daemon.php on line 936</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by njcalugar
2010-05-20T21:36:35+00:00
PHP: 5.3.2 OS: Mac OS X 10.5 Package Version: 0.10.3

Description:
------------
With error_reporting = E_ALL | E_STRICT:

Strict Standards: Non-static method System_Daemon::semantify() should not be called statically in /usr/local/zend/share/pear/System/Daemon.php on line 936</pre>]]></description>
      <dc:date>2010-05-22T15:58:16+00:00</dc:date>
      <dc:creator>njcalugar &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17332">
      <title>System_Daemon: Bug 17332 [Closed] pcntl_signal returns false in php 5.3</title>
      <link>http://pear.php.net/bugs/17332</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by jpiche
2010-04-21T20:39:10+00:00
PHP: 5.3.2 OS: Ubuntu 10.04 Package Version: 0.10.2

Description:
------------
Trying to start a daemon in 5.3 results in:

[Apr 21 10:26:43]  warning: [PHP Error] pcntl_signal(): Error 
assigning signal [l:1304]
[Apr 21 10:26:43]    emerg: Unable to reroute signal handler: 0 
[l:1308]

If it matters, this is using the package without PEAR.

Expected result:
----------------
Daemon started.

Actual result:
--------------
Daemon did not start.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by jpiche
2010-04-21T20:39:10+00:00
PHP: 5.3.2 OS: Ubuntu 10.04 Package Version: 0.10.2

Description:
------------
Trying to start a daemon in 5.3 results in:

[Apr 21 10:26:43]  warning: [PHP Error] pcntl_signal(): Error 
assigning signal [l:1304]
[Apr 21 10:26:43]    emerg: Unable to reroute signal handler: 0 
[l:1308]

If it matters, this is using the package without PEAR.

Expected result:
----------------
Daemon started.

Actual result:
--------------
Daemon did not start.</pre>]]></description>
      <dc:date>2010-05-04T17:13:58+00:00</dc:date>
      <dc:creator>j &amp;#x61;&amp;#116; jpiche &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17296">
      <title>System_Daemon: Bug 17296 [Closed] LOGGING error and SIGNAL names typed wrong</title>
      <link>http://pear.php.net/bugs/17296</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by johndoe
2010-04-06T14:11:32+00:00
PHP: 5.2.6 OS: Debian Lenny Package Version: 0.10.2

Description:
------------
Options are processed (with the defaults from the self:_optObj-&gt;_definitions values) too late and signal names are wrong!


Test script:
---------------
in .../System/Daemon.php :
static protected $_sigHandlers = array(
..
        'SIGIOT' =&gt; array('System_Daemon', 'defaultSigHandler'),
...
        'SIGCLD' =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIGCHLD' =&gt; array('System_Daemon', 'defaultSigHandler'),
...
        'SIGPOLL' =&gt; array('System_Daemon', 'defaultSigHandler'),
        SIGIO =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIGPWR' =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIGSYS' =&gt; array('System_Daemon', 'defaultSigHandler'),
        SIGBABY =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIG_BLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIG_UNBLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIG_SETMASK' =&gt; array('System_Daemon', 'defaultSigHandler'),);

there are some signal-handler names written in there string-representation. Thats wrong. consult: http://www.php.net/manual/en/pcntl.constants.php

That leads to an log-error / debug backtrace on initializing the signal-handlers. 

Expected result:
----------------
self::$_optObj is not initialized, when there is an error on early signalhandler setting:
System_Daemon::setSigHandler(SIGTERM, &quot;asmis_sig_handler&quot;);
System_Daemon::setSigHandler(SIGCHLD, &quot;asmis_sig_handler&quot;);

but self::opt('usePEARLogInstance') is not initialized, so log function is buggy:

static public function log($level, $str, $file = false, $class = false, 
    $function = false, $line = false)
{
   ...
   if (self::opt('usePEARLogInstance') !== false)
   {
            self::opt('usePEARLogInstance')-&gt;log($str, $level);
            return true;
   }
   ...
}
when the options aren't initialized 'usePEARLogInstance'-option is NULL and that's !== false, so 'usePEARLogInstance' is expected to be an PEAR LOG-object. but it is not and there is
no log-function to call.

possible bugfix should be:
self::opt('usePEARLogInstance') must process the options defintions, so self::opt('usePEARLogInstance') returns false, if it is not set by the user manually before on the daemon config lines.


Actual result:
--------------
Fatal error: Call to a member function log() on a non-object in /usr/share/php/System/Daemon.php on line 1009

Call Stack:
    0.0027     327164   1. {main}() /srv/www/rkerner/shs/core.ext/import/asmisd.php:0
    0.0327     807716   2. System_Daemon::setSigHandler() /srv/www/rkerner/shs/core.ext/import/asmisd.php:113
    0.0327     810948   3. System_Daemon::notice() /usr/share/php/System/Daemon.php:643
    0.0327     811244   4. call_user_func_array() /usr/share/php/System/Daemon.php:881
    0.0327     811244   5. System_Daemon::_ilog() /usr/share/php/System/Daemon.php:0
    0.0329     815308   6. System_Daemon::log() /usr/share/php/System/Daemon.php:958

object(System_Daemon_Options)#1 (4) {                               
  [&quot;_options:protected&quot;]=&gt;                                          
  array(14) {                                                       
    [&quot;appChkConfig&quot;]=&gt;                                              
    string(8) &quot;345 99 0&quot;                                            
    [&quot;sysMaxExecutionTime&quot;]=&gt;                                       
    int(0)                                                          
    [&quot;sysMaxInputTime&quot;]=&gt;                                           
    int(0)                                                          
    [&quot;sysMemoryLimit&quot;]=&gt;                                            
    string(4) &quot;128M&quot;                                                
    [&quot;appDieOnIdentityCrisis&quot;]=&gt;                                    
    bool(true)                                                      
    [&quot;appRunAsUID&quot;]=&gt;                                               
    int(555)                                                        
    [&quot;appRunAsGID&quot;]=&gt;                                               
    int(33)                                                         
    [&quot;logVerbosity&quot;]=&gt;                                              
    int(7)                                                          
    [&quot;logPhpErrors&quot;]=&gt;                                              
    bool(true)                                                      
    [&quot;logFilePosition&quot;]=&gt;                                           
    bool(true)                                                      
    [&quot;appName&quot;]=&gt;                                                   
    string(6) &quot;asmisd&quot;                                              
    [&quot;authorName&quot;]=&gt;                                                
    string(26) &quot;************&quot;                          
    [&quot;appDescription&quot;]=&gt;                                            
    string(25) &quot;************&quot;                          
    [&quot;authorEmail&quot;]=&gt;                                               
    string(16) &quot;info@************&quot;                                   
  }

as you see self::_optObj is not processed (to the defaults) on
System_Daemon::setSigHandler(SIGTERM, &quot;asmis_sig_handler&quot;);
System_Daemon::setSigHandler(SIGCHLD, &quot;asmis_sig_handler&quot;);
at the beginning of my deaemon.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by johndoe
2010-04-06T14:11:32+00:00
PHP: 5.2.6 OS: Debian Lenny Package Version: 0.10.2

Description:
------------
Options are processed (with the defaults from the self:_optObj-&gt;_definitions values) too late and signal names are wrong!


Test script:
---------------
in .../System/Daemon.php :
static protected $_sigHandlers = array(
..
        'SIGIOT' =&gt; array('System_Daemon', 'defaultSigHandler'),
...
        'SIGCLD' =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIGCHLD' =&gt; array('System_Daemon', 'defaultSigHandler'),
...
        'SIGPOLL' =&gt; array('System_Daemon', 'defaultSigHandler'),
        SIGIO =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIGPWR' =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIGSYS' =&gt; array('System_Daemon', 'defaultSigHandler'),
        SIGBABY =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIG_BLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIG_UNBLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
        'SIG_SETMASK' =&gt; array('System_Daemon', 'defaultSigHandler'),);

there are some signal-handler names written in there string-representation. Thats wrong. consult: http://www.php.net/manual/en/pcntl.constants.php

That leads to an log-error / debug backtrace on initializing the signal-handlers. 

Expected result:
----------------
self::$_optObj is not initialized, when there is an error on early signalhandler setting:
System_Daemon::setSigHandler(SIGTERM, &quot;asmis_sig_handler&quot;);
System_Daemon::setSigHandler(SIGCHLD, &quot;asmis_sig_handler&quot;);

but self::opt('usePEARLogInstance') is not initialized, so log function is buggy:

static public function log($level, $str, $file = false, $class = false, 
    $function = false, $line = false)
{
   ...
   if (self::opt('usePEARLogInstance') !== false)
   {
            self::opt('usePEARLogInstance')-&gt;log($str, $level);
            return true;
   }
   ...
}
when the options aren't initialized 'usePEARLogInstance'-option is NULL and that's !== false, so 'usePEARLogInstance' is expected to be an PEAR LOG-object. but it is not and there is
no log-function to call.

possible bugfix should be:
self::opt('usePEARLogInstance') must process the options defintions, so self::opt('usePEARLogInstance') returns false, if it is not set by the user manually before on the daemon config lines.


Actual result:
--------------
Fatal error: Call to a member function log() on a non-object in /usr/share/php/System/Daemon.php on line 1009

Call Stack:
    0.0027     327164   1. {main}() /srv/www/rkerner/shs/core.ext/import/asmisd.php:0
    0.0327     807716   2. System_Daemon::setSigHandler() /srv/www/rkerner/shs/core.ext/import/asmisd.php:113
    0.0327     810948   3. System_Daemon::notice() /usr/share/php/System/Daemon.php:643
    0.0327     811244   4. call_user_func_array() /usr/share/php/System/Daemon.php:881
    0.0327     811244   5. System_Daemon::_ilog() /usr/share/php/System/Daemon.php:0
    0.0329     815308   6. System_Daemon::log() /usr/share/php/System/Daemon.php:958

object(System_Daemon_Options)#1 (4) {                               
  [&quot;_options:protected&quot;]=&gt;                                          
  array(14) {                                                       
    [&quot;appChkConfig&quot;]=&gt;                                              
    string(8) &quot;345 99 0&quot;                                            
    [&quot;sysMaxExecutionTime&quot;]=&gt;                                       
    int(0)                                                          
    [&quot;sysMaxInputTime&quot;]=&gt;                                           
    int(0)                                                          
    [&quot;sysMemoryLimit&quot;]=&gt;                                            
    string(4) &quot;128M&quot;                                                
    [&quot;appDieOnIdentityCrisis&quot;]=&gt;                                    
    bool(true)                                                      
    [&quot;appRunAsUID&quot;]=&gt;                                               
    int(555)                                                        
    [&quot;appRunAsGID&quot;]=&gt;                                               
    int(33)                                                         
    [&quot;logVerbosity&quot;]=&gt;                                              
    int(7)                                                          
    [&quot;logPhpErrors&quot;]=&gt;                                              
    bool(true)                                                      
    [&quot;logFilePosition&quot;]=&gt;                                           
    bool(true)                                                      
    [&quot;appName&quot;]=&gt;                                                   
    string(6) &quot;asmisd&quot;                                              
    [&quot;authorName&quot;]=&gt;                                                
    string(26) &quot;************&quot;                          
    [&quot;appDescription&quot;]=&gt;                                            
    string(25) &quot;************&quot;                          
    [&quot;authorEmail&quot;]=&gt;                                               
    string(16) &quot;info@************&quot;                                   
  }

as you see self::_optObj is not processed (to the defaults) on
System_Daemon::setSigHandler(SIGTERM, &quot;asmis_sig_handler&quot;);
System_Daemon::setSigHandler(SIGCHLD, &quot;asmis_sig_handler&quot;);
at the beginning of my deaemon.</pre>]]></description>
      <dc:date>2010-04-08T18:06:41+00:00</dc:date>
      <dc:creator>rene &amp;#x64;&amp;#111;&amp;#x74; kerner &amp;#x61;&amp;#116; tacticx &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17263">
      <title>System_Daemon: Bug 17263 [Closed] minor mistake in examples/logparser.php</title>
      <link>http://pear.php.net/bugs/17263</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by ceejayoz
2010-03-25T00:27:52+00:00
PHP: 5.2.10 OS: Ubuntu Package Version: SVN

Description:
------------
The logparser.php example uses single quotes when outputting 
its help text, resulting in the \n newlines being output as text &quot;\n&quot; 
instead of actual new lines.

http://github.com/kvz/system_daemon/blob/master/examples/lo
gparser.php</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by ceejayoz
2010-03-25T00:27:52+00:00
PHP: 5.2.10 OS: Ubuntu Package Version: SVN

Description:
------------
The logparser.php example uses single quotes when outputting 
its help text, resulting in the \n newlines being output as text &quot;\n&quot; 
instead of actual new lines.

http://github.com/kvz/system_daemon/blob/master/examples/lo
gparser.php</pre>]]></description>
      <dc:date>2010-03-25T01:13:35+00:00</dc:date>
      <dc:creator>chris &amp;#x61;&amp;#116; sternal-johnson &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17254">
      <title>System_Daemon: Bug 17254 [Closed] Error assiging signal handler</title>
      <link>http://pear.php.net/bugs/17254</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by austinb
2010-03-23T00:33:59+00:00
PHP: 5.3.2 OS: CentOS 5.4 x86 Package Version: 0.10.2

Description:
------------
In reference to bug #17225 still having issues with 'SIG_BLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'), as defined as part of the $_sigHandlers array.  Either commenting it out or making it a constant refrence instead of a string makes it work properly.

Note this is PHP 5.3.2 on CentOS 5.4 x86 (32-bit). According to http://www.php.net/manual/en/pcntl.constants.php SIG_BLOCK plus alot more constants were added starting in 5.3.0.  Is it possible this is a compat problem between 5.2 and the 5.3 series?

Perhaps some version sniffing might be needed to correct thisissue?  I am unable to get any previously working 0.9.2 script to work in 0.10.1 or 0.10.2. 

If it helps this is my configure line:
'./configure' '--with-mysql=/usr/lib' '--with-zlib' '--with-openssl' '--with-mhash' '--with-mcrypt' '--with-gd' '--enable-ftp' '--enable-exif' '--with-jpeg-dir=/usr/lib' '--with-zlib-dir=/usr/lib' '--with-png-dir=/usr/lib' '--with-freetype-dir=/usr/lib' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-curl=/usr/lib' '--with-mysqli=/usr/bin/mysql_config' '--enable-cgi' '--enable-mbstring' '--enable-bcmath' '--enable-soap' '--with-readline' '--enable-pcntl' '--with-bz2' '--enable-zip' '--with-iconv' '--with-tidy' '--with-gettext=/usr/lib' 

Test script:
---------------
Any script that works in 0.9.2

Expected result:
----------------
Script launches are daemon and runs as it should.

Actual result:
--------------
[Mar 15 13:38:24]   notice: Startup written to '/etc/rc.d/init.d/StatsDaemon'
[Mar 15 13:38:24]   notice: Starting StatsDaemon daemon, output in: /var/log/StatsDaemon.log
[Mar 15 13:38:24]     info: Changed identify to 'apache':'apache'
[Mar 15 13:38:24]  warning: [PHP Error] pcntl_signal(): Error assigning signal [l:1289]
[Mar 15 13:38:24]    emerg: Unable to reroute signal handler: 0 [l:1293]</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by austinb
2010-03-23T00:33:59+00:00
PHP: 5.3.2 OS: CentOS 5.4 x86 Package Version: 0.10.2

Description:
------------
In reference to bug #17225 still having issues with 'SIG_BLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'), as defined as part of the $_sigHandlers array.  Either commenting it out or making it a constant refrence instead of a string makes it work properly.

Note this is PHP 5.3.2 on CentOS 5.4 x86 (32-bit). According to http://www.php.net/manual/en/pcntl.constants.php SIG_BLOCK plus alot more constants were added starting in 5.3.0.  Is it possible this is a compat problem between 5.2 and the 5.3 series?

Perhaps some version sniffing might be needed to correct thisissue?  I am unable to get any previously working 0.9.2 script to work in 0.10.1 or 0.10.2. 

If it helps this is my configure line:
'./configure' '--with-mysql=/usr/lib' '--with-zlib' '--with-openssl' '--with-mhash' '--with-mcrypt' '--with-gd' '--enable-ftp' '--enable-exif' '--with-jpeg-dir=/usr/lib' '--with-zlib-dir=/usr/lib' '--with-png-dir=/usr/lib' '--with-freetype-dir=/usr/lib' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-curl=/usr/lib' '--with-mysqli=/usr/bin/mysql_config' '--enable-cgi' '--enable-mbstring' '--enable-bcmath' '--enable-soap' '--with-readline' '--enable-pcntl' '--with-bz2' '--enable-zip' '--with-iconv' '--with-tidy' '--with-gettext=/usr/lib' 

Test script:
---------------
Any script that works in 0.9.2

Expected result:
----------------
Script launches are daemon and runs as it should.

Actual result:
--------------
[Mar 15 13:38:24]   notice: Startup written to '/etc/rc.d/init.d/StatsDaemon'
[Mar 15 13:38:24]   notice: Starting StatsDaemon daemon, output in: /var/log/StatsDaemon.log
[Mar 15 13:38:24]     info: Changed identify to 'apache':'apache'
[Mar 15 13:38:24]  warning: [PHP Error] pcntl_signal(): Error assigning signal [l:1289]
[Mar 15 13:38:24]    emerg: Unable to reroute signal handler: 0 [l:1293]</pre>]]></description>
      <dc:date>2010-05-04T17:13:13+00:00</dc:date>
      <dc:creator>austin &amp;#x64;&amp;#111;&amp;#x74; bischoff &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17225">
      <title>System_Daemon: Bug 17225 [Closed] Sig handler dies due to possible incorrectly defined sighandler</title>
      <link>http://pear.php.net/bugs/17225</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by austinb
2010-03-15T22:38:45+00:00
PHP: 5.3.0 OS: CentOS 5.4 Package Version: 0.10.1

Description:
------------
Seems there is a badly defined entry in the $_sigHandlers array.  The entry on line 415 in Daemon.php causes the issue.  Commenting out the line allows the daemon to start as expected.

static protected $_sigHandlers = array(
...
'SIG_BLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
...
);

Test script:
---------------
Any Daemon script that worked in 0.9.2

Expected result:
----------------
Script should start and become a daemon.

Actual result:
--------------
Script starts but then errors out with the following in the log:
[Mar 15 13:17:10]   notice: Startup written to '/etc/rc.d/init.d/StatsDaemon-'
[Mar 15 13:17:10]   notice: Starting StatsDaemon daemon, output in: /var/log/StatsDaemon.log
[Mar 15 13:17:10]  warning: Orphaned pidfile found and removed: /var/run/StatsDaemon/StatsDaemon.pid. Previous process crashed? [l:1223]
[Mar 15 13:17:10]  warning: [PHP Error] pcntl_signal(): Error assigning signal [l:1289]
[Mar 15 13:17:10]    emerg: Unable to reroute signal handler: 0 [l:1293]</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by austinb
2010-03-15T22:38:45+00:00
PHP: 5.3.0 OS: CentOS 5.4 Package Version: 0.10.1

Description:
------------
Seems there is a badly defined entry in the $_sigHandlers array.  The entry on line 415 in Daemon.php causes the issue.  Commenting out the line allows the daemon to start as expected.

static protected $_sigHandlers = array(
...
'SIG_BLOCK' =&gt; array('System_Daemon', 'defaultSigHandler'),
...
);

Test script:
---------------
Any Daemon script that worked in 0.9.2

Expected result:
----------------
Script should start and become a daemon.

Actual result:
--------------
Script starts but then errors out with the following in the log:
[Mar 15 13:17:10]   notice: Startup written to '/etc/rc.d/init.d/StatsDaemon-'
[Mar 15 13:17:10]   notice: Starting StatsDaemon daemon, output in: /var/log/StatsDaemon.log
[Mar 15 13:17:10]  warning: Orphaned pidfile found and removed: /var/run/StatsDaemon/StatsDaemon.pid. Previous process crashed? [l:1223]
[Mar 15 13:17:10]  warning: [PHP Error] pcntl_signal(): Error assigning signal [l:1289]
[Mar 15 13:17:10]    emerg: Unable to reroute signal handler: 0 [l:1293]</pre>]]></description>
      <dc:date>2010-03-16T00:31:11+00:00</dc:date>
      <dc:creator>austin &amp;#x64;&amp;#111;&amp;#x74; bischoff &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17224">
      <title>System_Daemon: Bug 17224 [Closed] Sig handler causes error</title>
      <link>http://pear.php.net/bugs/17224</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by garethm
2010-03-15T13:16:20+00:00
PHP: 5.2.10 OS: Centos Package Version: 0.10.1

Description:
------------
When attempting to create a sig handler the script returns an 
error:

Can only overrule on of these signal handlers: 'Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, 1, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array'

In addition the signal does not get caught and the application 
is terminated even in the middle of processing.

Test script:
---------------
require_once(&quot;System/Daemon.php&quot;); 

System_Daemon::setOption(&quot;appName&quot;, &quot;name&quot;); 
System_Daemon::setOption(&quot;appDescription&quot;, &quot;Description&quot;); 
System_Daemon::setOption(&quot;authorName&quot;, &quot;Name&quot;); 
System_Daemon::setOption(&quot;authorEmail&quot;, &quot;mail@mail.com&quot;); 

System_Daemon::setSigHandler(SIGKILL, array(&quot;System_Daemon&quot;,&quot;defaultSigHandler&quot;)); 

if (!System_Daemon::isInBackground() &amp;&amp; !System_Daemon::isRunning()) 
{ 
$init_path = System_Daemon::writeAutoRun(true); 

System_Daemon::start(); 

$sleep_time = 5; 


while (!System_Daemon::isDying()) 
{ 
//Code to run per loop 
} 
System_Daemon::notice(&quot;Termination signal recieved, exiting&quot;); 
} 

Expected result:
----------------
The sig handler gets set and when a termination signal for the 
running process is sent that the application manages shutting 
itself down instead of being killed outright

Actual result:
--------------
The error:

Can only overrule on of these signal handlers: 'Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, 1, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array'

and no signal capturing</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by garethm
2010-03-15T13:16:20+00:00
PHP: 5.2.10 OS: Centos Package Version: 0.10.1

Description:
------------
When attempting to create a sig handler the script returns an 
error:

Can only overrule on of these signal handlers: 'Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, 1, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array'

In addition the signal does not get caught and the application 
is terminated even in the middle of processing.

Test script:
---------------
require_once(&quot;System/Daemon.php&quot;); 

System_Daemon::setOption(&quot;appName&quot;, &quot;name&quot;); 
System_Daemon::setOption(&quot;appDescription&quot;, &quot;Description&quot;); 
System_Daemon::setOption(&quot;authorName&quot;, &quot;Name&quot;); 
System_Daemon::setOption(&quot;authorEmail&quot;, &quot;mail@mail.com&quot;); 

System_Daemon::setSigHandler(SIGKILL, array(&quot;System_Daemon&quot;,&quot;defaultSigHandler&quot;)); 

if (!System_Daemon::isInBackground() &amp;&amp; !System_Daemon::isRunning()) 
{ 
$init_path = System_Daemon::writeAutoRun(true); 

System_Daemon::start(); 

$sleep_time = 5; 


while (!System_Daemon::isDying()) 
{ 
//Code to run per loop 
} 
System_Daemon::notice(&quot;Termination signal recieved, exiting&quot;); 
} 

Expected result:
----------------
The sig handler gets set and when a termination signal for the 
running process is sent that the application manages shutting 
itself down instead of being killed outright

Actual result:
--------------
The error:

Can only overrule on of these signal handlers: 'Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, 1, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array'

and no signal capturing</pre>]]></description>
      <dc:date>2010-03-16T00:23:16+00:00</dc:date>
      <dc:creator>pear &amp;#x61;&amp;#116; nexustech &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; za</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17216">
      <title>System_Daemon: Bug 17216 [Closed] chgrp and chown require intval to operate correctly</title>
      <link>http://pear.php.net/bugs/17216</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by heygrady
2010-03-12T06:47:56+00:00
PHP: 5.2.11 OS: CentOS Package Version: 0.10.1

Description:
------------
http://us.php.net/manual/en/function.chown.php#53079

$gid = 48;
chgrp('/some/file', $gid); // false
chgrp('/some/file', intval($gid)); // true

When trying to use the appRunAsUID and appRunAsGID options the script always fails even though the UID and GID does indeed exist.

The log file continually returns messages similar to this:
[Mar 11 12:47:00]      err: Unable to change group of file '/some/file' to 48 [l:1413]
[Mar 11 12:47:00]     crit: Unable to change identity [l:1275]
[Mar 11 12:47:00]    emerg: Cannot continue after this [l:1277]

Using intval() around the UID and GID in the System_Daemon::_changeIdentity() function fixes the problem.

Test script:
---------------
$gid = 48;
chgrp('/some/file', $gid); // false
chgrp('/some/file', intval($gid)); // true</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by heygrady
2010-03-12T06:47:56+00:00
PHP: 5.2.11 OS: CentOS Package Version: 0.10.1

Description:
------------
http://us.php.net/manual/en/function.chown.php#53079

$gid = 48;
chgrp('/some/file', $gid); // false
chgrp('/some/file', intval($gid)); // true

When trying to use the appRunAsUID and appRunAsGID options the script always fails even though the UID and GID does indeed exist.

The log file continually returns messages similar to this:
[Mar 11 12:47:00]      err: Unable to change group of file '/some/file' to 48 [l:1413]
[Mar 11 12:47:00]     crit: Unable to change identity [l:1275]
[Mar 11 12:47:00]    emerg: Cannot continue after this [l:1277]

Using intval() around the UID and GID in the System_Daemon::_changeIdentity() function fixes the problem.

Test script:
---------------
$gid = 48;
chgrp('/some/file', $gid); // false
chgrp('/some/file', intval($gid)); // true</pre>]]></description>
      <dc:date>2010-03-14T21:05:08+00:00</dc:date>
      <dc:creator>pear &amp;#x61;&amp;#116; heygrady &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17184">
      <title>System_Daemon: Bug 17184 [Bogus] Annoying notice</title>
      <link>http://pear.php.net/bugs/17184</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by moiseev
2010-03-02T18:25:07+00:00
PHP: 5.2.12 OS: Linux Package Version: 0.10.1

Description:
------------
just create simple daemon

Expected result:
----------------
nothing

Actual result:
--------------
[PHP notice] Undefined index:  class in 
/usr/share/php/System/Daemon.php at line 951</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by moiseev
2010-03-02T18:25:07+00:00
PHP: 5.2.12 OS: Linux Package Version: 0.10.1

Description:
------------
just create simple daemon

Expected result:
----------------
nothing

Actual result:
--------------
[PHP notice] Undefined index:  class in 
/usr/share/php/System/Daemon.php at line 951</pre>]]></description>
      <dc:date>2010-05-22T15:59:01+00:00</dc:date>
      <dc:creator>moiseev &amp;#x64;&amp;#111;&amp;#x74; igor &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17169">
      <title>System_Daemon: Bug 17169 [Bogus] setting sigHanler</title>
      <link>http://pear.php.net/bugs/17169</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by neta
2010-02-26T09:34:04+00:00
PHP: 5.2.12 OS: Linux Package Version: 0.10.1

Description:
------------
Can't setSigHandler like below:

System_Daemon::setSigHandler(SIGCHLD, SIG_DFL);

Is this is bug? or my own conding problem?


Test script:
---------------
&lt;?php
require_once(&quot;Log.php&quot;);
require_once(&quot;System/Daemon.php&quot;);

$logger = &amp;Log::singleton('syslog', LOG_LOCAL4, &quot;test&quot;, null, 7);

$options = array(
    &quot;appName&quot; =&gt; &quot;testdaemon&quot;
    ,&quot;appDir&quot; =&gt; dirname(__FILE__)
    ,&quot;appDescription&quot; =&gt; &quot;pear system daemon test&quot;
    ,&quot;authorName&quot; =&gt; &quot;neta&quot;
    ,&quot;authorEmail&quot; =&gt; &quot;root@localhost&quot;
    ,&quot;sysMaxExecutionTime&quot; =&gt; &quot;0&quot;
    ,&quot;sysMaxInputTime&quot; =&gt; &quot;0&quot;
    ,&quot;appRunAsGID&quot; =&gt; 99  // nobody
    ,&quot;appRunAsUID&quot; =&gt; 99  // nobody
    ,&quot;usePEARLogInstance&quot; =&gt; $logger
);
System_Daemon::setOptions($options);
System_Daemon::setSigHandler(SIGCHLD, SIG_DFL);

System_Daemon::start();
while (!System_Daemon::isDying()) {
    System_Daemon::iterate(5);
    $logger-&gt;debug(&quot;bar&quot;);
}
System_Daemon::stop();
?&gt;


Actual result:
--------------
log message:

 Can only overrule on of these signal handlers: 'Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, 1, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array'</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by neta
2010-02-26T09:34:04+00:00
PHP: 5.2.12 OS: Linux Package Version: 0.10.1

Description:
------------
Can't setSigHandler like below:

System_Daemon::setSigHandler(SIGCHLD, SIG_DFL);

Is this is bug? or my own conding problem?


Test script:
---------------
&lt;?php
require_once(&quot;Log.php&quot;);
require_once(&quot;System/Daemon.php&quot;);

$logger = &amp;Log::singleton('syslog', LOG_LOCAL4, &quot;test&quot;, null, 7);

$options = array(
    &quot;appName&quot; =&gt; &quot;testdaemon&quot;
    ,&quot;appDir&quot; =&gt; dirname(__FILE__)
    ,&quot;appDescription&quot; =&gt; &quot;pear system daemon test&quot;
    ,&quot;authorName&quot; =&gt; &quot;neta&quot;
    ,&quot;authorEmail&quot; =&gt; &quot;root@localhost&quot;
    ,&quot;sysMaxExecutionTime&quot; =&gt; &quot;0&quot;
    ,&quot;sysMaxInputTime&quot; =&gt; &quot;0&quot;
    ,&quot;appRunAsGID&quot; =&gt; 99  // nobody
    ,&quot;appRunAsUID&quot; =&gt; 99  // nobody
    ,&quot;usePEARLogInstance&quot; =&gt; $logger
);
System_Daemon::setOptions($options);
System_Daemon::setSigHandler(SIGCHLD, SIG_DFL);

System_Daemon::start();
while (!System_Daemon::isDying()) {
    System_Daemon::iterate(5);
    $logger-&gt;debug(&quot;bar&quot;);
}
System_Daemon::stop();
?&gt;


Actual result:
--------------
log message:

 Can only overrule on of these signal handlers: 'Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, 1, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array, Array, Array, Array, 
Array, Array, Array, Array, Array, Array'</pre>]]></description>
      <dc:date>2010-05-22T15:59:04+00:00</dc:date>
      <dc:creator>neta-master &amp;#x61;&amp;#116; ywcafe &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17168">
      <title>System_Daemon: Bug 17168 [Closed] embarrassed log message</title>
      <link>http://pear.php.net/bugs/17168</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by neta
2010-02-26T09:30:33+00:00
PHP: 5.2.12 OS: Linux Package Version: 0.10.1

Description:
------------
I very thanks for your debug on #17152 .

but something embarrassed message is logged.


Test script:
---------------
&lt;?php
require_once(&quot;Log.php&quot;);
require_once(&quot;System/Daemon.php&quot;);

$logger = &amp;Log::singleton('syslog', LOG_LOCAL4, &quot;test&quot;, null, 7);

$options = array(
    &quot;appName&quot; =&gt; &quot;testdaemon&quot;
    ,&quot;appDir&quot; =&gt; dirname(__FILE__)
    ,&quot;appDescription&quot; =&gt; &quot;pear system daemon test&quot;
    ,&quot;authorName&quot; =&gt; &quot;neta&quot;
    ,&quot;authorEmail&quot; =&gt; &quot;root@localhost&quot;
    ,&quot;sysMaxExecutionTime&quot; =&gt; &quot;0&quot;
    ,&quot;sysMaxInputTime&quot; =&gt; &quot;0&quot;
    ,&quot;appRunAsGID&quot; =&gt; 99  // nobody
    ,&quot;appRunAsUID&quot; =&gt; 99  // nobody
    ,&quot;usePEARLogInstance&quot; =&gt; $logger
);
System_Daemon::setOptions($options);
System_Daemon::setSigHandler(SIGCHLD, SIG_DFL);

System_Daemon::start();
while (!System_Daemon::isDying()) {
    System_Daemon::iterate(5);
    $logger-&gt;debug(&quot;bar&quot;);
}
System_Daemon::stop();
?&gt;


Expected result:
----------------
log message:
Starting testdaemon daemon, output in: (PEAR Log)


Actual result:
--------------
log message:
Starting testdaemon daemon, output in: /var/log/testdaemon.log

(of course, /var/log/testdaemon.log not exists.)</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by neta
2010-02-26T09:30:33+00:00
PHP: 5.2.12 OS: Linux Package Version: 0.10.1

Description:
------------
I very thanks for your debug on #17152 .

but something embarrassed message is logged.


Test script:
---------------
&lt;?php
require_once(&quot;Log.php&quot;);
require_once(&quot;System/Daemon.php&quot;);

$logger = &amp;Log::singleton('syslog', LOG_LOCAL4, &quot;test&quot;, null, 7);

$options = array(
    &quot;appName&quot; =&gt; &quot;testdaemon&quot;
    ,&quot;appDir&quot; =&gt; dirname(__FILE__)
    ,&quot;appDescription&quot; =&gt; &quot;pear system daemon test&quot;
    ,&quot;authorName&quot; =&gt; &quot;neta&quot;
    ,&quot;authorEmail&quot; =&gt; &quot;root@localhost&quot;
    ,&quot;sysMaxExecutionTime&quot; =&gt; &quot;0&quot;
    ,&quot;sysMaxInputTime&quot; =&gt; &quot;0&quot;
    ,&quot;appRunAsGID&quot; =&gt; 99  // nobody
    ,&quot;appRunAsUID&quot; =&gt; 99  // nobody
    ,&quot;usePEARLogInstance&quot; =&gt; $logger
);
System_Daemon::setOptions($options);
System_Daemon::setSigHandler(SIGCHLD, SIG_DFL);

System_Daemon::start();
while (!System_Daemon::isDying()) {
    System_Daemon::iterate(5);
    $logger-&gt;debug(&quot;bar&quot;);
}
System_Daemon::stop();
?&gt;


Expected result:
----------------
log message:
Starting testdaemon daemon, output in: (PEAR Log)


Actual result:
--------------
log message:
Starting testdaemon daemon, output in: /var/log/testdaemon.log

(of course, /var/log/testdaemon.log not exists.)</pre>]]></description>
      <dc:date>2010-03-01T16:59:55+00:00</dc:date>
      <dc:creator>neta-master &amp;#x61;&amp;#116; ywcafe &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17152">
      <title>System_Daemon: Feature/Change Request 17152 [Closed] Log Configuration</title>
      <link>http://pear.php.net/bugs/17152</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by neta
2010-02-24T12:59:24+00:00
PHP: 5.2.12 OS: Linux Package Version: Unknown

Description:
------------
I use System_Daemon with PEAR/Log object 
using  like &quot;usePEARLogInstance&quot; =&gt; $mypearlogobject...

Although it, System_Daemon require &quot;logLocation&quot; setting
and check the file permission,owner, etc.

So, please ignore/no-check &quot;logLocation&quot; option while using 
&quot;usePEARLogInstance&quot;.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by neta
2010-02-24T12:59:24+00:00
PHP: 5.2.12 OS: Linux Package Version: Unknown

Description:
------------
I use System_Daemon with PEAR/Log object 
using  like &quot;usePEARLogInstance&quot; =&gt; $mypearlogobject...

Although it, System_Daemon require &quot;logLocation&quot; setting
and check the file permission,owner, etc.

So, please ignore/no-check &quot;logLocation&quot; option while using 
&quot;usePEARLogInstance&quot;.</pre>]]></description>
      <dc:date>2010-02-24T17:55:39+00:00</dc:date>
      <dc:creator>neta-master &amp;#x61;&amp;#116; ywcafe &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17069">
      <title>System_Daemon: Bug 17069 [Closed] Annoying Typo</title>
      <link>http://pear.php.net/bugs/17069</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by urda
2010-02-05T23:49:28+00:00
PHP: 5.2.5 OS: Ubuntu 9.10 Package Version: 0.9.2

Description:
------------
When System_Daemon is logging notice's to the log file, this 
log line shows...

[DATE] notice: starting {APPNAME} daemon, output in: {LOG 
LOCATION}

The &quot;s&quot; should be a capital &quot;S&quot; in the word starting. Looks out 
of place with the rest of the log file :\ 

That's it :)

Test script:
---------------
Run a System_Daemon that logs, with at least a log level for NOTICE

Expected result:
----------------
[DATE] notice: Starting {APPNAME} daemon, output in: {LOG 
LOCATION}

Actual result:
--------------
[DATE] notice: starting {APPNAME} daemon, output in: {LOG 
LOCATION}</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by urda
2010-02-05T23:49:28+00:00
PHP: 5.2.5 OS: Ubuntu 9.10 Package Version: 0.9.2

Description:
------------
When System_Daemon is logging notice's to the log file, this 
log line shows...

[DATE] notice: starting {APPNAME} daemon, output in: {LOG 
LOCATION}

The &quot;s&quot; should be a capital &quot;S&quot; in the word starting. Looks out 
of place with the rest of the log file :\ 

That's it :)

Test script:
---------------
Run a System_Daemon that logs, with at least a log level for NOTICE

Expected result:
----------------
[DATE] notice: Starting {APPNAME} daemon, output in: {LOG 
LOCATION}

Actual result:
--------------
[DATE] notice: starting {APPNAME} daemon, output in: {LOG 
LOCATION}</pre>]]></description>
      <dc:date>2010-02-08T13:19:03+00:00</dc:date>
      <dc:creator>peter &amp;#x64;&amp;#111;&amp;#x74; urda &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16981">
      <title>System_Daemon: Feature/Change Request 16981 [Closed] One instance daemon only?</title>
      <link>http://pear.php.net/bugs/16981</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by martinjanda
2010-01-08T16:06:52+00:00
PHP: 5.2.5 OS: Debian Lenny, Linux 2.6.2 Package Version: 0.9.2

Description:
------------
I'd like a new feature in System_Daemon to check whether the 
daemon once coming. I think this would great for more people.

Expected result:
----------------
For example as setting parametr:
System_Daemon::setOption(&quot;justOneInstance&quot;, true);</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by martinjanda
2010-01-08T16:06:52+00:00
PHP: 5.2.5 OS: Debian Lenny, Linux 2.6.2 Package Version: 0.9.2

Description:
------------
I'd like a new feature in System_Daemon to check whether the 
daemon once coming. I think this would great for more people.

Expected result:
----------------
For example as setting parametr:
System_Daemon::setOption(&quot;justOneInstance&quot;, true);</pre>]]></description>
      <dc:date>2010-01-08T17:09:19+00:00</dc:date>
      <dc:creator>info &amp;#x61;&amp;#116; martinjanda &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16980">
      <title>System_Daemon: Bug 16980 [Closed] init.d script doesn't stop daemon</title>
      <link>http://pear.php.net/bugs/16980</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by martinjanda
2010-01-08T15:57:12+00:00
PHP: 5.2.5 OS: Debian Lenny, Linux 2.6.2 Package Version: 0.9.2

Description:
------------
I use System_Daemon 0.9.2 on Debian Lenny, Linux 2.6.2 with 
php 5.2.9-4. It is really nice work.

I have one problem: created init.d script doesn't stop daemon. 
They do nothing. start parametr work. restart parametr just start  
daemon. 

Expected result:
----------------
I would like stop my daemon with generate init.d script</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by martinjanda
2010-01-08T15:57:12+00:00
PHP: 5.2.5 OS: Debian Lenny, Linux 2.6.2 Package Version: 0.9.2

Description:
------------
I use System_Daemon 0.9.2 on Debian Lenny, Linux 2.6.2 with 
php 5.2.9-4. It is really nice work.

I have one problem: created init.d script doesn't stop daemon. 
They do nothing. start parametr work. restart parametr just start  
daemon. 

Expected result:
----------------
I would like stop my daemon with generate init.d script</pre>]]></description>
      <dc:date>2010-01-08T18:06:07+00:00</dc:date>
      <dc:creator>info &amp;#x61;&amp;#116; martinjanda &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16966">
      <title>System_Daemon: Bug 16966 [Closed] Warnings displayed</title>
      <link>http://pear.php.net/bugs/16966</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by dumb
2010-01-04T18:18:14+00:00
PHP: 5.1.6 OS: Linux Package Version: 0.9.2

Description:
------------
I get a php warning at the start a php using this class, see below for details:

Expected result:
----------------
No warnings, no output

Actual result:
--------------
PHP Notice:  Use of undefined constant E_RECOVERABLE_ERROR - assumed 'E_RECOVERABLE_ERROR' in /usr/share/pear/System/Daemon.php on line 1359

Notice: Use of undefined constant E_RECOVERABLE_ERROR - assumed 'E_RECOVERABLE_ERROR' in /usr/share/pear/System/Daemon.php on line 1359</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by dumb
2010-01-04T18:18:14+00:00
PHP: 5.1.6 OS: Linux Package Version: 0.9.2

Description:
------------
I get a php warning at the start a php using this class, see below for details:

Expected result:
----------------
No warnings, no output

Actual result:
--------------
PHP Notice:  Use of undefined constant E_RECOVERABLE_ERROR - assumed 'E_RECOVERABLE_ERROR' in /usr/share/pear/System/Daemon.php on line 1359

Notice: Use of undefined constant E_RECOVERABLE_ERROR - assumed 'E_RECOVERABLE_ERROR' in /usr/share/pear/System/Daemon.php on line 1359</pre>]]></description>
      <dc:date>2010-01-06T15:08:46+00:00</dc:date>
      <dc:creator>pear &amp;#x61;&amp;#116; thedumbterminal &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16883">
      <title>System_Daemon: Bug 16883 [Closed] logLocation and pear log</title>
      <link>http://pear.php.net/bugs/16883</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by dumb
2009-12-07T21:00:35+00:00
PHP: 5.1.6 OS: linux Package Version: Unknown

Description:
------------
the &quot;logLocation&quot; option should not be required or used when using the &quot;usePEARLogInstance&quot;.

As a work around you can set  &quot;logLocation&quot; to a temp directory like &quot;/tmp/appname&quot;.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by dumb
2009-12-07T21:00:35+00:00
PHP: 5.1.6 OS: linux Package Version: Unknown

Description:
------------
the &quot;logLocation&quot; option should not be required or used when using the &quot;usePEARLogInstance&quot;.

As a work around you can set  &quot;logLocation&quot; to a temp directory like &quot;/tmp/appname&quot;.</pre>]]></description>
      <dc:date>2009-12-13T21:58:22+00:00</dc:date>
      <dc:creator>pear &amp;#x61;&amp;#116; thedumbterminal &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16882">
      <title>System_Daemon: Bug 16882 [Duplicate] logLocation and pear log</title>
      <link>http://pear.php.net/bugs/16882</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by dumb
2009-12-07T20:55:44+00:00
PHP: 5.1.6 OS: linux Package Version: Unknown

Description:
------------
the &quot;logLocation&quot; option should not be required or used when using the &quot;usePEARLogInstance&quot;.

As a work around you can set  &quot;logLocation&quot; to a temp directory like &quot;/tmp/appname&quot;.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by dumb
2009-12-07T20:55:44+00:00
PHP: 5.1.6 OS: linux Package Version: Unknown

Description:
------------
the &quot;logLocation&quot; option should not be required or used when using the &quot;usePEARLogInstance&quot;.

As a work around you can set  &quot;logLocation&quot; to a temp directory like &quot;/tmp/appname&quot;.</pre>]]></description>
      <dc:date>2010-05-22T15:59:07+00:00</dc:date>
      <dc:creator>pear &amp;#x61;&amp;#116; thedumbterminal &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16730">
      <title>System_Daemon: Feature/Change Request 16730 [Closed] Spin off Log related code in System_Daemon</title>
      <link>http://pear.php.net/bugs/16730</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by till
2009-10-23T17:53:11+00:00
PHP: 5.2.5 OS: n/a Package Version: 0.9.2

Description:
------------
IMHO, the System_Daemon::log() function and all related methods and constants, should be pushed into a System_Daemon_Log class.

Of course there's nothing particulary &quot;wrong&quot; with this code, but I feel like the System_Daemon class itself is too monolithic. It does too many things at the same time, in order to work with that, I'd suggest you spin off the log code into System_Daemon_Log. :-)</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by till
2009-10-23T17:53:11+00:00
PHP: 5.2.5 OS: n/a Package Version: 0.9.2

Description:
------------
IMHO, the System_Daemon::log() function and all related methods and constants, should be pushed into a System_Daemon_Log class.

Of course there's nothing particulary &quot;wrong&quot; with this code, but I feel like the System_Daemon class itself is too monolithic. It does too many things at the same time, in order to work with that, I'd suggest you spin off the log code into System_Daemon_Log. :-)</pre>]]></description>
      <dc:date>2010-02-24T08:23:40+00:00</dc:date>
      <dc:creator>till &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16729">
      <title>System_Daemon: Bug 16729 [Closed] Weird install paths</title>
      <link>http://pear.php.net/bugs/16729</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by till
2009-10-23T17:46:30+00:00
PHP: 5.2.5 OS: Ubuntu (9.10) Package Version: 0.9.2

Description:
------------
data /usr/share/php/data/System_Daemon/data/template_BSD
data /usr/share/php/data/System_Daemon/data/template_Debian
data /usr/share/php/data/System_Daemon/data/template_Fedora
data /usr/share/php/data/System_Daemon/data/template_RedHat
doc  /usr/share/php/doc/System_Daemon/docs/CHANGELOG
doc  /usr/share/php/doc/System_Daemon/docs/DESCRIPTION
doc  /usr/share/php/doc/System_Daemon/docs/MAINTAINERS
doc  /usr/share/php/doc/System_Daemon/docs/MAPPING
doc  /usr/share/php/doc/System_Daemon/docs/NOTES
doc  /usr/share/php/doc/System_Daemon/docs/OLD_NOTES
doc  /usr/share/php/doc/System_Daemon/docs/README
doc  /usr/share/php/doc/System_Daemon/docs/suggested_notes_format
doc  /usr/share/php/doc/System_Daemon/docs/SUMMARY
doc  /usr/share/php/doc/System_Daemon/docs/VERSION
doc  /usr/share/php/doc/System_Daemon/examples/bug_test_a.php
doc  /usr/share/php/doc/System_Daemon/examples/bug_test_b.php
doc  /usr/share/php/doc/System_Daemon/examples/bug_test_c.php
doc  /usr/share/php/doc/System_Daemon/examples/custtemplate.php
doc  /usr/share/php/doc/System_Daemon/examples/devtest.php
doc  /usr/share/php/doc/System_Daemon/examples/logparser.php
doc  /usr/share/php/doc/System_Daemon/examples/nopear.php
doc  /usr/share/php/doc/System_Daemon/examples/pearlog.php
doc  /usr/share/php/doc/System_Daemon/examples/phperrtest.php
doc  /usr/share/php/doc/System_Daemon/examples/simple.php
php  /usr/share/php/./nbproject/project.properties
php  /usr/share/php/./nbproject/project.xml
php  /usr/share/php/./System/Daemon/OS/BSD.php
php  /usr/share/php/./System/Daemon/OS/Debian.php
php  /usr/share/php/./System/Daemon/OS/Exception.php
php  /usr/share/php/./System/Daemon/OS/Fedora.php
php  /usr/share/php/./System/Daemon/OS/Linux.php
php  /usr/share/php/./System/Daemon/OS/RedHat.php
php  /usr/share/php/./System/Daemon/OS/Ubuntu.php
php  /usr/share/php/./System/Daemon/OS/Windows.php
php  /usr/share/php/./System/Daemon/Exception.php
php  /usr/share/php/./System/Daemon/Options.php
php  /usr/share/php/./System/Daemon/OS.php
php  /usr/share/php/./System/Daemon.php
test /usr/share/php/test/System_Daemon/tests/inbackground.phpt
test /usr/share/php/test/System_Daemon/tests/log.phpt
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.diff
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.exp
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.log
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.out
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.php
test /usr/share/php/test/System_Daemon/tests/os-getdetails.phpt
test /usr/share/php/test/System_Daemon/tests/tests-config.php
php  /usr/share/php/./tools/changelog_gen.php
php  /usr/share/php/./tools/package_gen.php
php  /usr/share/php/./package.xml.bak
php  /usr/share/php/./test.php

This should be fixed in your package.xml.

Test script:
---------------
pear install System_Daemon-beta

Expected result:
----------------
No, ./ in the paths.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by till
2009-10-23T17:46:30+00:00
PHP: 5.2.5 OS: Ubuntu (9.10) Package Version: 0.9.2

Description:
------------
data /usr/share/php/data/System_Daemon/data/template_BSD
data /usr/share/php/data/System_Daemon/data/template_Debian
data /usr/share/php/data/System_Daemon/data/template_Fedora
data /usr/share/php/data/System_Daemon/data/template_RedHat
doc  /usr/share/php/doc/System_Daemon/docs/CHANGELOG
doc  /usr/share/php/doc/System_Daemon/docs/DESCRIPTION
doc  /usr/share/php/doc/System_Daemon/docs/MAINTAINERS
doc  /usr/share/php/doc/System_Daemon/docs/MAPPING
doc  /usr/share/php/doc/System_Daemon/docs/NOTES
doc  /usr/share/php/doc/System_Daemon/docs/OLD_NOTES
doc  /usr/share/php/doc/System_Daemon/docs/README
doc  /usr/share/php/doc/System_Daemon/docs/suggested_notes_format
doc  /usr/share/php/doc/System_Daemon/docs/SUMMARY
doc  /usr/share/php/doc/System_Daemon/docs/VERSION
doc  /usr/share/php/doc/System_Daemon/examples/bug_test_a.php
doc  /usr/share/php/doc/System_Daemon/examples/bug_test_b.php
doc  /usr/share/php/doc/System_Daemon/examples/bug_test_c.php
doc  /usr/share/php/doc/System_Daemon/examples/custtemplate.php
doc  /usr/share/php/doc/System_Daemon/examples/devtest.php
doc  /usr/share/php/doc/System_Daemon/examples/logparser.php
doc  /usr/share/php/doc/System_Daemon/examples/nopear.php
doc  /usr/share/php/doc/System_Daemon/examples/pearlog.php
doc  /usr/share/php/doc/System_Daemon/examples/phperrtest.php
doc  /usr/share/php/doc/System_Daemon/examples/simple.php
php  /usr/share/php/./nbproject/project.properties
php  /usr/share/php/./nbproject/project.xml
php  /usr/share/php/./System/Daemon/OS/BSD.php
php  /usr/share/php/./System/Daemon/OS/Debian.php
php  /usr/share/php/./System/Daemon/OS/Exception.php
php  /usr/share/php/./System/Daemon/OS/Fedora.php
php  /usr/share/php/./System/Daemon/OS/Linux.php
php  /usr/share/php/./System/Daemon/OS/RedHat.php
php  /usr/share/php/./System/Daemon/OS/Ubuntu.php
php  /usr/share/php/./System/Daemon/OS/Windows.php
php  /usr/share/php/./System/Daemon/Exception.php
php  /usr/share/php/./System/Daemon/Options.php
php  /usr/share/php/./System/Daemon/OS.php
php  /usr/share/php/./System/Daemon.php
test /usr/share/php/test/System_Daemon/tests/inbackground.phpt
test /usr/share/php/test/System_Daemon/tests/log.phpt
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.diff
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.exp
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.log
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.out
test /usr/share/php/test/System_Daemon/tests/os-determine.phpt.php
test /usr/share/php/test/System_Daemon/tests/os-getdetails.phpt
test /usr/share/php/test/System_Daemon/tests/tests-config.php
php  /usr/share/php/./tools/changelog_gen.php
php  /usr/share/php/./tools/package_gen.php
php  /usr/share/php/./package.xml.bak
php  /usr/share/php/./test.php

This should be fixed in your package.xml.

Test script:
---------------
pear install System_Daemon-beta

Expected result:
----------------
No, ./ in the paths.</pre>]]></description>
      <dc:date>2009-10-24T00:41:54+00:00</dc:date>
      <dc:creator>till &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16640">
      <title>System_Daemon: Bug 16640 [Closed] [PHP Error] pcntl_signal(): Error assigning signal [l:1110]</title>
      <link>http://pear.php.net/bugs/16640</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by leening
2009-09-24T18:21:52+00:00
PHP: 5.2.5 OS: Linux Ubuntu 9.04 Package Version: CVS

Description:
------------
I've replace Daemon.php with the version from git but get the following error:

[Sep 24 14:06:10]   notice: starting test daemon, output in: /var/tmp/oooqd.log
[Sep 24 14:06:10]  warning: [PHP Error] pcntl_signal(): Error assigning signal [l:1110]
[Sep 24 14:06:10]    emerg: test daemon was unable to reroute signal handler 0 [l:1113]


Test script:
---------------
Standard test script as per example, with added System_Daemon::setSigHandler calls, but even without them i get this error.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by leening
2009-09-24T18:21:52+00:00
PHP: 5.2.5 OS: Linux Ubuntu 9.04 Package Version: CVS

Description:
------------
I've replace Daemon.php with the version from git but get the following error:

[Sep 24 14:06:10]   notice: starting test daemon, output in: /var/tmp/oooqd.log
[Sep 24 14:06:10]  warning: [PHP Error] pcntl_signal(): Error assigning signal [l:1110]
[Sep 24 14:06:10]    emerg: test daemon was unable to reroute signal handler 0 [l:1113]


Test script:
---------------
Standard test script as per example, with added System_Daemon::setSigHandler calls, but even without them i get this error.</pre>]]></description>
      <dc:date>2009-09-25T17:08:54+00:00</dc:date>
      <dc:creator>leening &amp;#x61;&amp;#116; dmmw &amp;#x64;&amp;#111;&amp;#x74; nl</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16638">
      <title>System_Daemon: Feature/Change Request 16638 [Closed] Possibility to add more signals</title>
      <link>http://pear.php.net/bugs/16638</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by leening
2009-09-24T13:46:06+00:00
PHP: 5.2.5 OS: Ubuntu Linux 9.04 Package Version: 0.9.2

Description:
------------
It would be nice to have the ability to add more signals
Eg. right now only SIGUSR1 is defined, but SIGUSR2 would come in handy (or any other signal for that matter)

Test script:
---------------
System_Daemon::setSigHandler(SIGUSR2, &quot;myActionTwo&quot;);

Expected result:
----------------
That the daemon responds to SIGUSR2 :-)</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by leening
2009-09-24T13:46:06+00:00
PHP: 5.2.5 OS: Ubuntu Linux 9.04 Package Version: 0.9.2

Description:
------------
It would be nice to have the ability to add more signals
Eg. right now only SIGUSR1 is defined, but SIGUSR2 would come in handy (or any other signal for that matter)

Test script:
---------------
System_Daemon::setSigHandler(SIGUSR2, &quot;myActionTwo&quot;);

Expected result:
----------------
That the daemon responds to SIGUSR2 :-)</pre>]]></description>
      <dc:date>2009-09-24T17:00:46+00:00</dc:date>
      <dc:creator>leening &amp;#x61;&amp;#116; dmmw &amp;#x64;&amp;#111;&amp;#x74; nl</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16511">
      <title>System_Daemon: Bug 16511 [Closed] Strange behaviour</title>
      <link>http://pear.php.net/bugs/16511</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by johnmjackson
2009-08-11T03:14:43+00:00
PHP: 5.2.5 OS: RHEL5 Package Version: 0.9.0

Description:
------------
Following the last bug I reported and your fix, I installed version 0.9.0.  I left the daemon running and after approx 1 hour 30 mins I got reports of the server running slow.  When I checked again the daemon wasn't running.  I didn't have anything being logged as I get some PHP notices/warnings which I didn't want logged.  Nothing shows in the daemon's log or the messages log.

After restarting the daemon, I SSH'd back into the server again about 10 minutes later, and the daemon wasn't running (i.e. sleeping) again.  The messages log does show the service starting and being stopped when I did so, but doesn't show any details of the mysterious shutdowns.

Another symptom I found was when using an SSH console the message 'Received signal 17' or 'Received 17' or similar (can't quite remember) occasionally appeared.

I have now reverted to the 0.8.1 version and used my workaround using logging.  Seems to be working OK.

Sorry I can't give any better details, I only have a production linux server so I had to go straight back to the 0.8.1 version.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by johnmjackson
2009-08-11T03:14:43+00:00
PHP: 5.2.5 OS: RHEL5 Package Version: 0.9.0

Description:
------------
Following the last bug I reported and your fix, I installed version 0.9.0.  I left the daemon running and after approx 1 hour 30 mins I got reports of the server running slow.  When I checked again the daemon wasn't running.  I didn't have anything being logged as I get some PHP notices/warnings which I didn't want logged.  Nothing shows in the daemon's log or the messages log.

After restarting the daemon, I SSH'd back into the server again about 10 minutes later, and the daemon wasn't running (i.e. sleeping) again.  The messages log does show the service starting and being stopped when I did so, but doesn't show any details of the mysterious shutdowns.

Another symptom I found was when using an SSH console the message 'Received signal 17' or 'Received 17' or similar (can't quite remember) occasionally appeared.

I have now reverted to the 0.8.1 version and used my workaround using logging.  Seems to be working OK.

Sorry I can't give any better details, I only have a production linux server so I had to go straight back to the 0.8.1 version.</pre>]]></description>
      <dc:date>2009-08-11T05:22:38+00:00</dc:date>
      <dc:creator>john &amp;#x64;&amp;#111;&amp;#x74; jackson &amp;#x61;&amp;#116; flgtechnology &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16500">
      <title>System_Daemon: Bug 16500 [Closed] Daemon cannot be killed when not writing to log</title>
      <link>http://pear.php.net/bugs/16500</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by johnmjackson
2009-08-08T21:49:30+00:00
PHP: 5.2.5 OS: RHEL5 Package Version: 0.8.1

Description:
------------
I am using a while loop as in your example, but when I do something within the loop, use the iterate() function and then loop without writing anything to the log, the daemon doesn't seem to respond to the kill signal.

The result is that using '/etc/init.d/[daemon] stop' does nothing for 60 seconds and then reports that it has timed out.

Test script:
---------------
This works:

$runningOkay = true;
 
while (!System_Daemon::isDying() &amp;&amp; $runningOkay) {
	
	System_Daemon::log(System_Daemon::LOG_INFO, &quot;Daemon: '&quot;.
    System_Daemon::getOption(&quot;appName&quot;).
    &quot;' checked for jobs at &quot;.
    gmdate(&quot;Y-m-d H:i:s&quot;, time() + (3600 * date(&quot;I&quot;))));

    $runningOkay = fncProcessJobs();
    System_Daemon::iterate(2);
    
}

This doesn't:

$runningOkay = true;
 
while (!System_Daemon::isDying() &amp;&amp; $runningOkay) {
	
    $runningOkay = fncProcessJobs();
    System_Daemon::iterate(2);
    
}

Expected result:
----------------
I would expect the daemon to be killed regardless of whether a log is written to (is this allowable with daemons?).

Actual result:
--------------
The kill signal is ignored.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by johnmjackson
2009-08-08T21:49:30+00:00
PHP: 5.2.5 OS: RHEL5 Package Version: 0.8.1

Description:
------------
I am using a while loop as in your example, but when I do something within the loop, use the iterate() function and then loop without writing anything to the log, the daemon doesn't seem to respond to the kill signal.

The result is that using '/etc/init.d/[daemon] stop' does nothing for 60 seconds and then reports that it has timed out.

Test script:
---------------
This works:

$runningOkay = true;
 
while (!System_Daemon::isDying() &amp;&amp; $runningOkay) {
	
	System_Daemon::log(System_Daemon::LOG_INFO, &quot;Daemon: '&quot;.
    System_Daemon::getOption(&quot;appName&quot;).
    &quot;' checked for jobs at &quot;.
    gmdate(&quot;Y-m-d H:i:s&quot;, time() + (3600 * date(&quot;I&quot;))));

    $runningOkay = fncProcessJobs();
    System_Daemon::iterate(2);
    
}

This doesn't:

$runningOkay = true;
 
while (!System_Daemon::isDying() &amp;&amp; $runningOkay) {
	
    $runningOkay = fncProcessJobs();
    System_Daemon::iterate(2);
    
}

Expected result:
----------------
I would expect the daemon to be killed regardless of whether a log is written to (is this allowable with daemons?).

Actual result:
--------------
The kill signal is ignored.</pre>]]></description>
      <dc:date>2009-08-10T21:06:11+00:00</dc:date>
      <dc:creator>john &amp;#x64;&amp;#111;&amp;#x74; jackson &amp;#x61;&amp;#116; flgtechnology &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16414">
      <title>System_Daemon: Bug 16414 [Bogus] write to init.d failure</title>
      <link>http://pear.php.net/bugs/16414</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by gameshas
2009-07-07T18:37:02+00:00
PHP: 5.2.5 OS: Debian Package Version: 0.8.1

Description:
------------
if script is executed with root permissions it still can't write to init.d folder.

script name FVasterisk
it has permissions a+x, file owner root.
i become root with su pior to execution and then run script like so:
./FVasterisk

ps aux output
webman  5864  0.0  1.2  36368  6596 pts/1    S    15:27   0:00 /usr/bin/php5 -q ./FVasterisk

webman is alias for root. Set in /etc/aliases.

should i give the www-data user write permissions to /etc/init.d ?

if so please add this do documentation.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by gameshas
2009-07-07T18:37:02+00:00
PHP: 5.2.5 OS: Debian Package Version: 0.8.1

Description:
------------
if script is executed with root permissions it still can't write to init.d folder.

script name FVasterisk
it has permissions a+x, file owner root.
i become root with su pior to execution and then run script like so:
./FVasterisk

ps aux output
webman  5864  0.0  1.2  36368  6596 pts/1    S    15:27   0:00 /usr/bin/php5 -q ./FVasterisk

webman is alias for root. Set in /etc/aliases.

should i give the www-data user write permissions to /etc/init.d ?

if so please add this do documentation.</pre>]]></description>
      <dc:date>2009-07-27T16:53:49+00:00</dc:date>
      <dc:creator>justinas &amp;#x61;&amp;#116; infospalvos &amp;#x64;&amp;#111;&amp;#x74; lt</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16144">
      <title>System_Daemon: Feature/Change Request 16144 [Bogus] Add ability to notify script of signals</title>
      <link>http://pear.php.net/bugs/16144</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by garrettmoon
2009-04-23T00:46:04+00:00
PHP: 5.2.9 OS: Debian Package Version: 0.7.0

Description:
------------
It would be nice if there was a callback function or something like it to 
notify the script that it's going to die so it can do cleanup of its own. I 
believe this could be currently achieved by overloading _die(), but a 
callback seems cleaner. Maybe I'm just missing something?</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by garrettmoon
2009-04-23T00:46:04+00:00
PHP: 5.2.9 OS: Debian Package Version: 0.7.0

Description:
------------
It would be nice if there was a callback function or something like it to 
notify the script that it's going to die so it can do cleanup of its own. I 
believe this could be currently achieved by overloading _die(), but a 
callback seems cleaner. Maybe I'm just missing something?</pre>]]></description>
      <dc:date>2012-07-17T16:13:55+00:00</dc:date>
      <dc:creator>garrett &amp;#x61;&amp;#116; pondry &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16136">
      <title>System_Daemon: Bug 16136 [Closed] init.d stop does not work</title>
      <link>http://pear.php.net/bugs/16136</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by garrettmoon
2009-04-22T04:46:26+00:00
PHP: 5.2.9 OS: Debian Package Version: 0.7.0

Description:
------------
This appears to have to do with PIDFILE being set incorrectly in the init.d 
autogenerated script on DEBIAN.

PIDFILE is not replaced with appPidLocation.

A fix is adding the line:
&quot;/var/run/\$NAME.pid&quot;  =&gt; '{PROPERTIES.appPidLocation}',
in the $autoRunTemplateReplace array in Debian.php

I'm not sure if there are other issues as well as RedHat.php uses the 
variable pidFile which I don't find anywhere.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by garrettmoon
2009-04-22T04:46:26+00:00
PHP: 5.2.9 OS: Debian Package Version: 0.7.0

Description:
------------
This appears to have to do with PIDFILE being set incorrectly in the init.d 
autogenerated script on DEBIAN.

PIDFILE is not replaced with appPidLocation.

A fix is adding the line:
&quot;/var/run/\$NAME.pid&quot;  =&gt; '{PROPERTIES.appPidLocation}',
in the $autoRunTemplateReplace array in Debian.php

I'm not sure if there are other issues as well as RedHat.php uses the 
variable pidFile which I don't find anywhere.</pre>]]></description>
      <dc:date>2009-04-25T15:24:52+00:00</dc:date>
      <dc:creator>garrett &amp;#x61;&amp;#116; pondry &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16135">
      <title>System_Daemon: Feature/Change Request 16135 [Closed] Suppressed errors get logged.</title>
      <link>http://pear.php.net/bugs/16135</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by garrettmoon
2009-04-22T02:20:02+00:00
PHP: 5.2.9 OS: OS X 10.5 Package Version: 0.7.0

Description:
------------
If an statement is prepended with the suppression operator @ it is still 
logged by the daemon.</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by garrettmoon
2009-04-22T02:20:02+00:00
PHP: 5.2.9 OS: OS X 10.5 Package Version: 0.7.0

Description:
------------
If an statement is prepended with the suppression operator @ it is still 
logged by the daemon.</pre>]]></description>
      <dc:date>2009-04-25T15:20:45+00:00</dc:date>
      <dc:creator>garrett &amp;#x61;&amp;#116; pondry &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15991">
      <title>System_Daemon: Feature/Change Request 15991 [Closed] Handle SIGPIPE</title>
      <link>http://pear.php.net/bugs/15991</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by mplomer
2009-03-08T02:43:58+00:00
PHP: 5.2.9 OS: Linux Package Version: 0.6.9

Description:
------------
I think SIGPIPE should also be handled (ignored) by default in $_sigHandlers, because if the daemon implements a socket server, a broken pipe should not cause the server to shut down.

What do you think?</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by mplomer
2009-03-08T02:43:58+00:00
PHP: 5.2.9 OS: Linux Package Version: 0.6.9

Description:
------------
I think SIGPIPE should also be handled (ignored) by default in $_sigHandlers, because if the daemon implements a socket server, a broken pipe should not cause the server to shut down.

What do you think?</pre>]]></description>
      <dc:date>2009-04-25T15:43:39+00:00</dc:date>
      <dc:creator>mplomer &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15929">
      <title>System_Daemon: Bug 15929 [Bogus] System_Daemon::restart();</title>
      <link>http://pear.php.net/bugs/15929</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by diemuzi
2009-02-23T03:32:47+00:00
PHP: 5.2.8 OS: Archlinux Package Version: 

Description:
------------
         I tested this with my development code and something seemed odd as PHP started to go &lt;defunct&gt; on me.

System_Daemon::start();
System_Daemon::restart();
System_Daemon::stop();

Using the restart() produced multiple PHP &lt;defunct&gt; items.

Test script:
---------------
         #!/usr/local/bin/php -q
&lt;?php
error_reporting(E_ALL);

// Start System Daemon (PEAR)
require_once &quot;Daemon.php&quot;;

// Allowed arguments &amp; their defaults
$runmode = array(
	&quot;no-daemon&quot; 	=&gt; true,
	&quot;help&quot; 			=&gt; false,
	&quot;write-initd&quot; 	=&gt; false
);

// Options
$options = array(
	'appName' 				=&gt; 'queue_test',
	'appDir' 				=&gt; dirname(__FILE__),
	'sysMaxExecutionTime' 	=&gt; '0',
	'sysMaxInputTime' 		=&gt; '0',
	'sysMemoryLimit' 		=&gt; '1024M'
);
System_Daemon::setOptions($options);

// Overrule the signal handler with any function
System_Daemon::setSigHandler(SIGCONT, array(&quot;System_Daemon&quot;, &quot;defaultSigHandler&quot;));

System_Daemon::start();
System_Daemon::restart();
System_Daemon::stop();
?&gt;

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] &lt;defunct&gt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by diemuzi
2009-02-23T03:32:47+00:00
PHP: 5.2.8 OS: Archlinux Package Version: 

Description:
------------
         I tested this with my development code and something seemed odd as PHP started to go &lt;defunct&gt; on me.

System_Daemon::start();
System_Daemon::restart();
System_Daemon::stop();

Using the restart() produced multiple PHP &lt;defunct&gt; items.

Test script:
---------------
         #!/usr/local/bin/php -q
&lt;?php
error_reporting(E_ALL);

// Start System Daemon (PEAR)
require_once &quot;Daemon.php&quot;;

// Allowed arguments &amp; their defaults
$runmode = array(
	&quot;no-daemon&quot; 	=&gt; true,
	&quot;help&quot; 			=&gt; false,
	&quot;write-initd&quot; 	=&gt; false
);

// Options
$options = array(
	'appName' 				=&gt; 'queue_test',
	'appDir' 				=&gt; dirname(__FILE__),
	'sysMaxExecutionTime' 	=&gt; '0',
	'sysMaxInputTime' 		=&gt; '0',
	'sysMemoryLimit' 		=&gt; '1024M'
);
System_Daemon::setOptions($options);

// Overrule the signal handler with any function
System_Daemon::setSigHandler(SIGCONT, array(&quot;System_Daemon&quot;, &quot;defaultSigHandler&quot;));

System_Daemon::start();
System_Daemon::restart();
System_Daemon::stop();
?&gt;

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] &lt;defunct&gt;</pre>]]></description>
      <dc:date>2009-03-02T15:48:52+00:00</dc:date>
      <dc:creator>diemuzi &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15927">
      <title>System_Daemon: Bug 15927 [Closed] can't pid file option setting</title>
      <link>http://pear.php.net/bugs/15927</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by neta
2009-02-22T14:37:14+00:00
PHP: 5.2.5 OS: Linux Package Version: 

Description:
------------
      Is this a bug ? or my code is wrong?


Test script:
---------------
      &lt;?php
require_once(&quot;System/Daemon.php&quot;); 
System_Daemon::setOption(&quot;appName&quot;, &quot;mydaemon&quot;);
System_Daemon::setOption(&quot;appPidLocation&quot;, &quot;/tmp/mydaemon.pid&quot;);
System_Daemon::setOption(&quot;logLocation&quot;, &quot;/tmp/mydaemon.log&quot;);
System_Daemon::start(); // 
?&gt;

Expected result:
----------------
      (No error occur)

Actual result:
--------------
         $ php daemon.php
[Feb 22 18:33:05]     info: starting mydaemon daemon, output in: /tmp/mydaemon.log
PHP Fatal error:  Uncaught System_Daemon_Exception: [Feb 22 18:33:05]    emerg: mydaemon daemon was unable to write pid file [l:959] in /usr/local/lib/php/System/Daemon.php on line 959
#0 /usr/local/lib/php/System/Daemon.php(959): System_Daemon::log(0, 'mydaemon daemon...')
#1 /usr/local/lib/php/System/Daemon.php(457): System_Daemon::_summon()
#2 /home/watanabe/tmp/daemon.php(6): System_Daemon::start()
#3 {main}
  thrown in /usr/local/lib/php/System/Daemon.php on line 701

Fatal error: Uncaught System_Daemon_Exception: [Feb 22 18:33:05]    emerg: mydaemon daemon was unable to write pid file [l:959] in /usr/local/lib/php/System/Daemon.php on line 959
#0 /usr/local/lib/php/System/Daemon.php(959): System_Daemon::log(0, 'mydaemon daemon...')
#1 /usr/local/lib/php/System/Daemon.php(457): System_Daemon::_summon()
#2 /home/watanabe/tmp/daemon.php(6): System_Daemon::start()
#3 {main}
  thrown in /usr/local/lib/php/System/Daemon.php on line 701</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by neta
2009-02-22T14:37:14+00:00
PHP: 5.2.5 OS: Linux Package Version: 

Description:
------------
      Is this a bug ? or my code is wrong?


Test script:
---------------
      &lt;?php
require_once(&quot;System/Daemon.php&quot;); 
System_Daemon::setOption(&quot;appName&quot;, &quot;mydaemon&quot;);
System_Daemon::setOption(&quot;appPidLocation&quot;, &quot;/tmp/mydaemon.pid&quot;);
System_Daemon::setOption(&quot;logLocation&quot;, &quot;/tmp/mydaemon.log&quot;);
System_Daemon::start(); // 
?&gt;

Expected result:
----------------
      (No error occur)

Actual result:
--------------
         $ php daemon.php
[Feb 22 18:33:05]     info: starting mydaemon daemon, output in: /tmp/mydaemon.log
PHP Fatal error:  Uncaught System_Daemon_Exception: [Feb 22 18:33:05]    emerg: mydaemon daemon was unable to write pid file [l:959] in /usr/local/lib/php/System/Daemon.php on line 959
#0 /usr/local/lib/php/System/Daemon.php(959): System_Daemon::log(0, 'mydaemon daemon...')
#1 /usr/local/lib/php/System/Daemon.php(457): System_Daemon::_summon()
#2 /home/watanabe/tmp/daemon.php(6): System_Daemon::start()
#3 {main}
  thrown in /usr/local/lib/php/System/Daemon.php on line 701

Fatal error: Uncaught System_Daemon_Exception: [Feb 22 18:33:05]    emerg: mydaemon daemon was unable to write pid file [l:959] in /usr/local/lib/php/System/Daemon.php on line 959
#0 /usr/local/lib/php/System/Daemon.php(959): System_Daemon::log(0, 'mydaemon daemon...')
#1 /usr/local/lib/php/System/Daemon.php(457): System_Daemon::_summon()
#2 /home/watanabe/tmp/daemon.php(6): System_Daemon::start()
#3 {main}
  thrown in /usr/local/lib/php/System/Daemon.php on line 701</pre>]]></description>
      <dc:date>2009-02-23T20:35:37+00:00</dc:date>
      <dc:creator>neta-master &amp;#x61;&amp;#116; ywcafe &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15926">
      <title>System_Daemon: Bug 15926 [Closed] can't pid file option setting</title>
      <link>http://pear.php.net/bugs/15926</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by neta
2009-02-22T14:36:37+00:00
PHP: 5.2.5 OS: Linux Package Version: 

Description:
------------
      Is this a bug ? or my code is wrong?


Test script:
---------------
      &lt;?php
require_once(&quot;System/Daemon.php&quot;); 
System_Daemon::setOption(&quot;appName&quot;, &quot;mydaemon&quot;);
System_Daemon::setOption(&quot;appPidLocation&quot;, &quot;/tmp/mydaemon.pid&quot;);
System_Daemon::setOption(&quot;logLocation&quot;, &quot;/tmp/mydaemon.log&quot;);
System_Daemon::start(); // 
?&gt;

Expected result:
----------------
      (No error occur)

Actual result:
--------------
         $ php daemon.php
[Feb 22 18:33:05]     info: starting mydaemon daemon, output in: /tmp/mydaemon.log
PHP Fatal error:  Uncaught System_Daemon_Exception: [Feb 22 18:33:05]    emerg: mydaemon daemon was unable to write pid file [l:959] in /usr/local/lib/php/System/Daemon.php on line 959
#0 /usr/local/lib/php/System/Daemon.php(959): System_Daemon::log(0, 'mydaemon daemon...')
#1 /usr/local/lib/php/System/Daemon.php(457): System_Daemon::_summon()
#2 /home/watanabe/tmp/daemon.php(6): System_Daemon::start()
#3 {main}
  thrown in /usr/local/lib/php/System/Daemon.php on line 701

Fatal error: Uncaught System_Daemon_Exception: [Feb 22 18:33:05]    emerg: mydaemon daemon was unable to write pid file [l:959] in /usr/local/lib/php/System/Daemon.php on line 959
#0 /usr/local/lib/php/System/Daemon.php(959): System_Daemon::log(0, 'mydaemon daemon...')
#1 /usr/local/lib/php/System/Daemon.php(457): System_Daemon::_summon()
#2 /home/watanabe/tmp/daemon.php(6): System_Daemon::start()
#3 {main}
  thrown in /usr/local/lib/php/System/Daemon.php on line 701</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by neta
2009-02-22T14:36:37+00:00
PHP: 5.2.5 OS: Linux Package Version: 

Description:
------------
      Is this a bug ? or my code is wrong?


Test script:
---------------
      &lt;?php
require_once(&quot;System/Daemon.php&quot;); 
System_Daemon::setOption(&quot;appName&quot;, &quot;mydaemon&quot;);
System_Daemon::setOption(&quot;appPidLocation&quot;, &quot;/tmp/mydaemon.pid&quot;);
System_Daemon::setOption(&quot;logLocation&quot;, &quot;/tmp/mydaemon.log&quot;);
System_Daemon::start(); // 
?&gt;

Expected result:
----------------
      (No error occur)

Actual result:
--------------
         $ php daemon.php
[Feb 22 18:33:05]     info: starting mydaemon daemon, output in: /tmp/mydaemon.log
PHP Fatal error:  Uncaught System_Daemon_Exception: [Feb 22 18:33:05]    emerg: mydaemon daemon was unable to write pid file [l:959] in /usr/local/lib/php/System/Daemon.php on line 959
#0 /usr/local/lib/php/System/Daemon.php(959): System_Daemon::log(0, 'mydaemon daemon...')
#1 /usr/local/lib/php/System/Daemon.php(457): System_Daemon::_summon()
#2 /home/watanabe/tmp/daemon.php(6): System_Daemon::start()
#3 {main}
  thrown in /usr/local/lib/php/System/Daemon.php on line 701

Fatal error: Uncaught System_Daemon_Exception: [Feb 22 18:33:05]    emerg: mydaemon daemon was unable to write pid file [l:959] in /usr/local/lib/php/System/Daemon.php on line 959
#0 /usr/local/lib/php/System/Daemon.php(959): System_Daemon::log(0, 'mydaemon daemon...')
#1 /usr/local/lib/php/System/Daemon.php(457): System_Daemon::_summon()
#2 /home/watanabe/tmp/daemon.php(6): System_Daemon::start()
#3 {main}
  thrown in /usr/local/lib/php/System/Daemon.php on line 701</pre>]]></description>
      <dc:date>2009-03-26T14:18:40+00:00</dc:date>
      <dc:creator>neta-master &amp;#x61;&amp;#116; ywcafe &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15895">
      <title>System_Daemon: Feature/Change Request 15895 [Closed] RedHat Support</title>
      <link>http://pear.php.net/bugs/15895</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by ifeghali
2009-02-12T23:35:52+00:00
PHP: 5.1.6 OS:  Package Version: 

Description:
------------
   Patch attached.

Test script:
---------------
      

Expected result:
----------------
      

Actual result:
--------------</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by ifeghali
2009-02-12T23:35:52+00:00
PHP: 5.1.6 OS:  Package Version: 

Description:
------------
   Patch attached.

Test script:
---------------
      

Expected result:
----------------
      

Actual result:
--------------</pre>]]></description>
      <dc:date>2009-02-17T14:24:59+00:00</dc:date>
      <dc:creator>ifeghali &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15894">
      <title>System_Daemon: Bug 15894 [Closed] getAutoRunTemplate reads wrong path</title>
      <link>http://pear.php.net/bugs/15894</link>
      <content:encoded><![CDATA[<pre>System_Daemon Bug
Reported by ifeghali
2009-02-12T23:27:06+00:00
PHP: 5.1.6 OS:  Package Version: 

Description:
------------
   OS::getAutoRunTemplate() reads the wrong path when autoRunTemplatePath is set to false. Please see patch attached.

Test script:
---------------
      

Expected result:
----------------
      

Actual result:
--------------</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Bug
Reported by ifeghali
2009-02-12T23:27:06+00:00
PHP: 5.1.6 OS:  Package Version: 

Description:
------------
   OS::getAutoRunTemplate() reads the wrong path when autoRunTemplatePath is set to false. Please see patch attached.

Test script:
---------------
      

Expected result:
----------------
      

Actual result:
--------------</pre>]]></description>
      <dc:date>2009-02-15T17:50:36+00:00</dc:date>
      <dc:creator>ifeghali &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15891">
      <title>System_Daemon: Documentation Problem 15891 [Closed] End User Docs</title>
      <link>http://pear.php.net/bugs/15891</link>
      <content:encoded><![CDATA[<pre>System_Daemon Documentation Problem
Reported by ifeghali
2009-02-11T21:39:55+00:00
PHP: 5.2.8 OS:  Package Version: 

Description:
------------
   It would be super to have some end user docs. The examples at &quot;docs/examples&quot; are not clear enough on basic program usage for the newbie user. Some important points are unclear, like what all those die()s are doing along the code, how to correctly loops your code etc.

For instance, in &quot;logparser.php&quot; one's code (line 107) is outside the loop (line 120). so how is that supposed to work ? newbie users to parallel programming and threads might not get the idea behind the package without proper end user documentation.

Maybe some prose just about the basic concepts can be enough.

Test script:
---------------
      

Expected result:
----------------
      

Actual result:
--------------</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Documentation Problem
Reported by ifeghali
2009-02-11T21:39:55+00:00
PHP: 5.2.8 OS:  Package Version: 

Description:
------------
   It would be super to have some end user docs. The examples at &quot;docs/examples&quot; are not clear enough on basic program usage for the newbie user. Some important points are unclear, like what all those die()s are doing along the code, how to correctly loops your code etc.

For instance, in &quot;logparser.php&quot; one's code (line 107) is outside the loop (line 120). so how is that supposed to work ? newbie users to parallel programming and threads might not get the idea behind the package without proper end user documentation.

Maybe some prose just about the basic concepts can be enough.

Test script:
---------------
      

Expected result:
----------------
      

Actual result:
--------------</pre>]]></description>
      <dc:date>2009-02-20T21:58:19+00:00</dc:date>
      <dc:creator>ifeghali &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>System_Daemon Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14230">
      <title>System_Daemon: Feature/Change Request 14230 [Closed] check for posix extension</title>
      <link>http://pear.php.net/bugs/14230</link>
      <content:encoded><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by temp
2008-06-24T23:47:02+00:00
PHP: 5.2.6 OS: Gentoo Linux Package Version: 0.4.0

Description:
------------
Calling the demo script, i'm getting this error:

Fatal error: Call to undefined function posix_getpid() in /usr/share/php/System/Daemon.php on line 918

On my gentoo system the posix extension wasn't compiled in, maybe you should check for the existance of the function, or even the complete extension. And add this to the dependencies.

Test script:
---------------
-

Expected result:
----------------
-

Actual result:
--------------
-</pre>]]></content:encoded>
      <description><![CDATA[<pre>System_Daemon Feature/Change Request
Reported by temp
2008-06-24T23:47:02+00:00
PHP: 5.2.6 OS: Gentoo Linux Package Version: 0.4.0

Description:
------------
Calling the demo script, i'm getting this error:

Fatal error: Call to undefined function posix_getpid() in /usr/share/php/System/Daemon.php on line 918

On my gentoo system the posix extension wasn't compiled in, maybe you should check for the existance of the function, or even the complete extension. And add this to the dependencies.

Test script:
---------------
-

Expected result:
----------------
-

Actual result:
--------------
-</pre>]]></description>
      <dc:date>2008-07-17T08:23:52+00:00</dc:date>
      <dc:creator>stephan &amp;#x61;&amp;#116; wentz &amp;#x64;&amp;#111;&amp;#x74; it</dc:creator>
      <dc:subject>System_Daemon Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
