[Pm-utils] [PATCH 6/7] (pm-utils 1.2.4) Match gentoo message "started" when checking for running services

Dan Nicholson victor.lowther at gmail.com
Thu Jan 29 05:52:06 PST 2009


Gentoo uses the convention of printing the message "started" when
showing the status of services. Augment stopservice() to check this in
addition to "running". This also drops the unnecessary -c argument from
the grep command.

Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
---
 pm/functions.in |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pm/functions.in b/pm/functions.in
index 70740cb..019e8d2 100644
--- a/pm/functions.in
+++ b/pm/functions.in
@@ -141,7 +141,8 @@ fi
 
 stopservice()
 {
-	if service "$1" status 2>/dev/null | grep -c -q running; then
+	if service "$1" status 2>/dev/null | grep -q -e running -e started
+	then
 		touch "${STORAGEDIR}/service:$1"
 		service "$1" stop
 	fi
-- 
1.6.0.6



More information about the Pm-utils mailing list