[PATCH] Match gentoo message "started" when checking for running services

Dan Nicholson dbn.lists at gmail.com
Sun Jan 18 11:20:47 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.5.6.6


More information about the Pm-utils mailing list