$directory = dirname($_SERVER["argv"][0]);
if (substr($directory, 0, 1) != "/") {
- $directory = $_SERVER["PWD"]."/".$directory;
+ $directory = $_SERVER["PWD"] . "/" . $directory;
}
- $directory = realpath($directory."/..");
+ $directory = realpath($directory . "/..");
chdir($directory);
}
die("Unexpected script behaviour. This message should never occur.\n");
}
-$pid = @file_get_contents($pidfile);
+$pid = null;
+
+if (is_readable($pidfile)) {
+ $pid = intval(file_get_contents($pidfile));
+}
if (empty($pid) && in_array($mode, ["stop", "status"])) {
Config::set('system', 'worker_daemon_mode', false);