Update bin/daemon.php

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
Michael Vogel 2023-12-05 22:45:16 +01:00 committed by GitHub
parent 8827d4c142
commit f430e06f80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,8 +163,7 @@ if (!$foreground) {
exit(1); exit(1);
} elseif ($pid) { } elseif ($pid) {
// The parent process continues here // The parent process continues here
file_put_contents($pidfile, $pid); if (!file_put_contents($pidfile, $pid)) {
if (!is_readable($pidfile)) {
echo "Pid file wasn't written.\n"; echo "Pid file wasn't written.\n";
Logger::warning('Could not store pid file'); Logger::warning('Could not store pid file');
posix_kill($pid, SIGTERM); posix_kill($pid, SIGTERM);