forked from GNUsocial/gnu-social
more output in daemon.php
darcs-hash:20081005000851-34904-9d4db52b2b9aaf7567f3c0762a68c3e192740bdf.gz
This commit is contained in:
parent
a43d24b1b8
commit
9db29d42dd
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user