mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Use procatat instead of ps as the latter always prints a header, also
use full paths.
This commit is contained in:
parent
cae1b7db89
commit
6661ea2525
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user