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);
} elseif ($pid) {
// The parent process continues here
file_put_contents($pidfile, $pid);
if (!is_readable($pidfile)) {
if (!file_put_contents($pidfile, $pid)) {
echo "Pid file wasn't written.\n";
Logger::warning('Could not store pid file');
posix_kill($pid, SIGTERM);