Notify.php
authorAlan Knowles <alan@akbkhome.com>
Fri, 3 Feb 2012 04:09:54 +0000 (12:09 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 3 Feb 2012 04:09:54 +0000 (12:09 +0800)
Notify.php

index 789b5e0..76f017f 100644 (file)
@@ -218,12 +218,16 @@ class Pman_Core_Notify extends Pman
         foreach($this->pool as $p) {
              
             echo "CHECK PID: " . $p['pid'] . "\n";
+            $info =  proc_get_status($p['proc']);
             
-            if (file_exists('/proc/'.$p['pid'])) {
+            if ($info['running']) {
+            
+            //if (file_exists('/proc/'.$p['pid'])) {
                 $pool[] = $p;
                 continue;
             }
             echo "ENDED: " . $p['cmd'] . " : " . file_get_contents($p['out']) . "\n";
+            proc_close($p['proc'])
             //unlink($p['out']);
         }
         echo "POOL SIZE: ". count($pool) ."\n";