diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 7a0eccfeb0..02b235ce37 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 -p {$pid}")) != ''); + $running = (trim(shell_exec("/usr/bin/procstat {$pid} 2>/dev/null")) != ''); return $running; } diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 686810f846..76dba778fb 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -50,7 +50,7 @@ function isvalidpid($pid) { } function is_process_running($process) { - $running = (shell_exec("pgrep -x {$process}") != ''); + $running = (shell_exec("/bin/pgrep -x {$process}") != ''); return $running; }