public function shutdown($block = true, $signal = SIGTERM)
{
if (empty($this->pid)) {
throw new \LogicException('the process pid is null, so maybe the process is not started');
}
if (!$this->isRunning()) {
throw new \LogicException("the process is not running");
}
if (!posix_kill($this->pid, $signal)) {
throw new \RuntimeException("kill son process failed");
}
$this->updateStatus($block);
}