Package: pm-utils / 1.4.1-9

80-service.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Debian does not support the "status" action for all init scripts (yet),
# so we simply assume that the service is running.
# Make use of invoke-rc.d.

Index: pm-utils/pm/functions.in
===================================================================
--- pm-utils.orig/pm/functions.in	2010-07-05 18:25:36.842318966 +0200
+++ pm-utils/pm/functions.in	2010-07-05 18:51:49.246322633 +0200
@@ -143,16 +143,16 @@
 
 stopservice()
 {
-	if service "$1" status 2>/dev/null | grep -q -e running -e started
+	if [ -x "/etc/init.d/$1" ]
 	then
 		touch "${STORAGEDIR}/service:$1"
-		service "$1" stop
+		invoke-rc.d "$1" stop
 	fi
 }
 
 restartservice()
 {
-	[ -O "${STORAGEDIR}/service:$1" ] && service "$1" start
+	[ -O "${STORAGEDIR}/service:$1" ] && invoke-rc.d "$1" start
 }
 
 # Disable a hook.