/** * send signal to master process * * @return void */ public function sendSignalToMaster($sig = SIGTERM) { $this->log->info('----> sending signal to master. signal: ' . $sig); posix_kill($this->masterPid, $sig); $this->log->info('<---- sent signal.'); $status = null; $this->pcntl->waitpid($this->masterPid, $status); $this->log->info('. status: ' . $status); $this->masterPid = null; }
/** * @param int $sig * @return void */ public function terminate($sig) { posix_kill($this->fork->getPid(), $sig); $status = null; $this->pcntl->waitpid($this->fork->getPid(), $status); }