@@ 219-222 (lines=4) @@ | ||
216 | } |
|
217 | ||
218 | if (!file_exists(Daemon::$config->pidfile->value)) { |
|
219 | if (!touch(Daemon::$config->pidfile->value)) { |
|
220 | Daemon::log('[EMERG] Couldn\'t create pid-file \'' . Daemon::$config->pidfile->value . '\'.'); |
|
221 | $error = true; |
|
222 | } |
|
223 | ||
224 | Bootstrap::$pid = 0; |
|
225 | } elseif (!is_file(Daemon::$config->pidfile->value)) { |
|
@@ 225-229 (lines=5) @@ | ||
222 | } |
|
223 | ||
224 | Bootstrap::$pid = 0; |
|
225 | } elseif (!is_file(Daemon::$config->pidfile->value)) { |
|
226 | Daemon::log('Pid-file \'' . Daemon::$config->pidfile->value . '\' must be a regular file.'); |
|
227 | Bootstrap::$pid = false; |
|
228 | $error = true; |
|
229 | } elseif (!is_writable(Daemon::$config->pidfile->value)) { |
|
230 | Daemon::log('Pid-file \'' . Daemon::$config->pidfile->value . '\' must be writable.'); |
|
231 | $error = true; |
|
232 | } elseif (!is_readable(Daemon::$config->pidfile->value)) { |
|
@@ 232-236 (lines=5) @@ | ||
229 | } elseif (!is_writable(Daemon::$config->pidfile->value)) { |
|
230 | Daemon::log('Pid-file \'' . Daemon::$config->pidfile->value . '\' must be writable.'); |
|
231 | $error = true; |
|
232 | } elseif (!is_readable(Daemon::$config->pidfile->value)) { |
|
233 | Daemon::log('Pid-file \'' . Daemon::$config->pidfile->value . '\' must be readable.'); |
|
234 | Bootstrap::$pid = false; |
|
235 | $error = true; |
|
236 | } else { |
|
237 | Bootstrap::$pid = (int)file_get_contents(Daemon::$config->pidfile->value); |
|
238 | } |
|
239 |