summaryrefslogtreecommitdiffstats
path: root/etc/inc/service-utils.inc
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-06-28 00:43:28 +0000
committerColin Smith <colin@pfsense.org>2005-06-28 00:43:28 +0000
commit8f24e17c7ef46392999482f15d572f49bc35efe8 (patch)
treef59e1c83a00b1b729785a8140209850b90c0b42a /etc/inc/service-utils.inc
parentc45cff0b3983538e5dc552122d7cf245beb0bcbc (diff)
downloadpfsense-8f24e17c7ef46392999482f15d572f49bc35efe8.zip
pfsense-8f24e17c7ef46392999482f15d572f49bc35efe8.tar.gz
Add suggested fix for is_process_running(), which seems broken.
Diffstat (limited to 'etc/inc/service-utils.inc')
-rw-r--r--etc/inc/service-utils.inc13
1 files changed, 13 insertions, 0 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc
index b66b7bb..46df94e 100644
--- a/etc/inc/service-utils.inc
+++ b/etc/inc/service-utils.inc
@@ -123,6 +123,19 @@ function restart_service($name) {
}
}
+/*
+The current version of this function doesn't appear to work on my system.
+It returns 1 occasionally even when a nonsensical process is passed.
+
+The below function appears to fix this behavior:
+
+function is_process_running($process) {
+ $status = `/bin/ps ax | /usr/bin/grep {$process} | grep -v grep | wc -l`;
+ if($status > 0) return 1;
+ return 0;
+}
+*/
+
function is_process_running($process) {
$status = `/bin/ps ax | /usr/bin/grep {$process} | wc -l`;
if($status > 2) return 1;
OpenPOWER on IntegriCloud