fix terminate
[Pman.Core] / Notify.php
index 95b446a..19413eb 100644 (file)
@@ -475,6 +475,8 @@ class Pman_Core_Notify extends Pman
         foreach($this->pool as $p) {
              
             //echo "CHECK PID: " . $p['pid'] . "\n";
+            
+            
             $info =  proc_get_status($p['proc']);
             //var_dump($info);
             
@@ -522,8 +524,14 @@ class Pman_Core_Notify extends Pman
             //fclose($p['pipes'][1]);
             
             proc_close($p['proc']);
-            
-            
+            proc_terminate($p['proc'], 9);
+            sleep(1);
+            clearstatcache();
+            if (file_exists('/proc/'. $p['pid'])) {
+                $this->logecho("proc PID={$p['pid']} still here - trying to wait");
+                pcntl_waitpid($p['pid'], $status, WNOHANG);
+            }
+
             //clearstatcache();
             //if (file_exists('/proc/'.$p['pid'])) {
             //    $pool[] = $p;