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); }
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']); } }