コード例 #1
0
ファイル: Service.php プロジェクト: reggi49/plansys
 protected function afterAction($action, $params, $exitCode = 0)
 {
     if (isset($this->service['name'])) {
         $this->log("SERVICE: Service {$this->service['name']} exited with code {$exitCode} [PID: {$this->pid}] ");
         ServiceManager::markAsStopped($this->service['name'], $this->id);
     }
     return parent::afterAction($action, $params, $exitCode);
 }
コード例 #2
0
ファイル: ServiceManager.php プロジェクト: rizabudi/plansys
 public static function kill($name)
 {
     $result = ServiceManager::getRunningInstance($name);
     foreach ($result as $r) {
         ServiceManager::log($name, $r['id'], "SERVICE: " . str_pad("Killing instance #{$r['id']}", 45, "."));
         ServiceManager::process("kill {$r['pid']}");
         ServiceManager::logAppend($name, $r['id'], "[OK]");
         ServiceManager::markAsStopped($name, $r['id']);
     }
 }