From 9e47f136d1075b0dbe19c949e9ab93d572f89a2d Mon Sep 17 00:00:00 2001 From: Paul Blacknell Date: Tue, 1 Feb 2022 11:38:19 +0000 Subject: [PATCH] fix: change the ask nicely kill to use SIGTERM --- .gitignore | 1 + src/Watchdog.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f489971..f70ae43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor/* /.idea/* *.cache +.DS_Store diff --git a/src/Watchdog.php b/src/Watchdog.php index 8af1032..7c67bae 100644 --- a/src/Watchdog.php +++ b/src/Watchdog.php @@ -106,7 +106,7 @@ public function watch(string $watchScript, string $watchScriptGrep, string $watc $processes = self::getProcesses($processlist); foreach ($processes as $process) { $this->logger->info(sprintf("Asking process %s to exit gracefully", $process['pid']), [[$this->hostName, $this->ipAddress, getmypid()], $process]); - exec(sprintf("kill -1 %s > /dev/null 2>&1", $process['pid'])); // 1 is equiv to HUP or SIGHUP + exec(sprintf("kill -15 %s > /dev/null 2>&1", $process['pid'])); // 15 is SIGTERM } sleep(2);