Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/daemon/PhutilDaemonHandle.php
| Show First 20 Lines • Show All 350 Lines • ▼ Show 20 Lines | final class PhutilDaemonHandle extends Phobject { | ||||
| private function annihilateProcessGroup() { | private function annihilateProcessGroup() { | ||||
| $pid = $this->getPID(); | $pid = $this->getPID(); | ||||
| if ($pid) { | if ($pid) { | ||||
| $pgid = posix_getpgid($pid); | $pgid = posix_getpgid($pid); | ||||
| if ($pgid) { | if ($pgid) { | ||||
| posix_kill(-$pgid, SIGTERM); | posix_kill(-$pgid, SIGTERM); | ||||
| sleep($this->getKillDelay()); | sleep($this->getKillDelay()); | ||||
| posix_kill(-$pgid, SIGKILL); | posix_kill(-$pgid, SIGKILL); | ||||
| $this->pid = null; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| private function startDaemonProcess() { | private function startDaemonProcess() { | ||||
| $this->logMessage('INIT', pht('Starting process.')); | $this->logMessage('INIT', pht('Starting process.')); | ||||
| $this->deadline = time() + $this->getRequiredHeartbeatFrequency(); | $this->deadline = time() + $this->getRequiredHeartbeatFrequency(); | ||||
| ▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines | |||||