diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/util.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 1e5fb79..858d663 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -41,11 +41,13 @@ function killbypid($pidfile) { return sigkillbypid($pidfile, "TERM"); } -function isvalidpid($pid) { +function isvalidpid($pidfile) { $output = ""; - exec("/bin/pgrep -nF {$pid}", $output, $retval); - - return (intval($retval) == 0); + if (file_exists($pidfile)) { + exec("/bin/pgrep -nF {$pidfile}", $output, $retval); + return (intval($retval) == 0); + } + return false; } function is_process_running($process) { |