diff options
author | Colin Smith <colin@pfsense.org> | 2005-06-26 03:57:18 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-06-26 03:57:18 +0000 |
commit | 1f846058583cc73b6a8241469abab68a3936eedc (patch) | |
tree | 8cd88f554ea8da34a6763b2b4c4e735cbc3f8aae /etc/inc/service-utils.inc | |
parent | 9dcc6787a2c02a2f12f1b2f95a325eb3ef4a841a (diff) | |
download | pfsense-1f846058583cc73b6a8241469abab68a3936eedc.zip pfsense-1f846058583cc73b6a8241469abab68a3936eedc.tar.gz |
Revert is_service_running to rev 1.10.
Diffstat (limited to 'etc/inc/service-utils.inc')
-rw-r--r-- | etc/inc/service-utils.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 9f9a487..8845a95 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -131,11 +131,18 @@ function is_process_running($process) { function is_service_running($service, $ps = "") { global $config; + 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($config['installedpackages']['service']) { foreach($config['installedpackages']['service'] as $aservice) { if($service == $aservice['name']) { if(!$aservice['executable']) return false; - if(is_process_running($aservice['executable'], $ps)) { + if(in_array($aservice['executable'], $ps)) { return true; } else { return false; |