more output in daemon.php

darcs-hash:20081005000851-34904-9d4db52b2b9aaf7567f3c0762a68c3e192740bdf.gz
This commit is contained in:
Evan Prodromou 2008-10-04 20:08:51 -04:00
parent a43d24b1b8
commit 9db29d42dd

View File

@ -28,6 +28,7 @@ class Daemon {
function background() {
$pid = pcntl_fork();
if ($pid < 0) { # error
common_log(LOG_ERR, "Could not fork.");
return false;
} else if ($pid > 0) { # parent
common_log(LOG_INFO, "Successfully forked.");
@ -63,12 +64,15 @@ class Daemon {
return false;
}
file_put_contents($pidfilename, posix_getpid() . "\n");
return file_put_contents($pidfilename, posix_getpid() . "\n");
}
function clearPidFile() {
$pidfilename = $this->pidFilename();
unlink($pidfilename);
if (!$pidfilename) {
return false;
}
return unlink($pidfilename);
}
function pidFilename() {