Skip to content

Commit

Permalink
fix: change the ask nicely kill to use SIGTERM
Browse files Browse the repository at this point in the history
  • Loading branch information
blacknell committed Feb 1, 2022
1 parent 3cc510b commit 9e47f13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/*
/.idea/*
*.cache
.DS_Store
2 changes: 1 addition & 1 deletion src/Watchdog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 9e47f13

Please sign in to comment.