summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-06-26 03:57:18 +0000
committerColin Smith <colin@pfsense.org>2005-06-26 03:57:18 +0000
commit1f846058583cc73b6a8241469abab68a3936eedc (patch)
tree8cd88f554ea8da34a6763b2b4c4e735cbc3f8aae
parent9dcc6787a2c02a2f12f1b2f95a325eb3ef4a841a (diff)
downloadpfsense-1f846058583cc73b6a8241469abab68a3936eedc.zip
pfsense-1f846058583cc73b6a8241469abab68a3936eedc.tar.gz
Revert is_service_running to rev 1.10.
-rw-r--r--etc/inc/service-utils.inc9
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;
OpenPOWER on IntegriCloud