diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/service-utils.inc | 4 | ||||
-rw-r--r-- | etc/inc/util.inc | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 0d4c1e1..7a0eccf 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -146,7 +146,7 @@ function restart_service($name) { function is_pid_running($pidfile) { $pid = trim(file_get_contents($pidfile)); - $running = (trim(shell_exec("ps axwu | grep '\b{$pid}\b' | grep -v 'grep'")) != ''); + $running = (trim(shell_exec("ps -p {$pid}")) != ''); return $running; } @@ -195,4 +195,4 @@ function is_service_running($service, $ps = "") { } } -?>
\ No newline at end of file +?> diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 9bae752..686810f 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -50,7 +50,7 @@ function isvalidpid($pid) { } function is_process_running($process) { - $running = (trim(shell_exec("ps axwu | grep '\b{$process}\b' | grep -v 'grep'")) != ''); + $running = (shell_exec("pgrep -x {$process}") != ''); return $running; } |