diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-06-25 23:06:43 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-06-25 23:06:43 +0000 |
commit | 4c943221a4de412c64d7070dc2ac567402923993 (patch) | |
tree | 98b0498c165321a407dbf64cf3aef3caa3f388f0 /etc/inc | |
parent | 148ed32fd1e6d9295921f406ea009db3be8b121d (diff) | |
download | pfsense-4c943221a4de412c64d7070dc2ac567402923993.zip pfsense-4c943221a4de412c64d7070dc2ac567402923993.tar.gz |
Make is_process_running() work as it should for the frickin 5th time.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/service-utils.inc | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 602eee6..d2ab1c8 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -124,19 +124,9 @@ function restart_service($name) { } function is_process_running($process, $ps = "") { - if(!$ps) { - exec("/bin/ps ax | awk '{ print $5 }'", $psout); - array_shift($psout); - foreach($psout as $line) { - $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line))))); - } - } - if(in_array($process, $ps)) { - return true; - } else { - return false; - } - return false; + $status = `/bin/ps ax | /usr/bin/grep {$service_name} | wc -l`; + if($status > 2) return 1; + return 0; } function is_service_running($service, $ps = "") { |