summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/util.inc9
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 90a5f9f..e4efbfb 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -42,11 +42,10 @@ function killbypid($pidfile) {
}
function isvalidpid($pid) {
- $running = `ps -p $pid | wc -l`;
- if(intval($running) > 1)
- return true;
- else
- return false;
+ $output = "";
+ exec("/bin/pgrep -F {$pid}", $output, $retval);
+
+ return (intval($retval) == 0);
}
function is_process_running($process) {
OpenPOWER on IntegriCloud