Package: asterisk
Version: 1:1.4.21.2~dfsg-2
Severity: normal
Tags: patch, init-status

This trivial patch uses the lsb-base standard way of gathering and
reporting status in the init script.

This patch comes from Ubuntu, which is carrying the diff.

Cheers,
:-Dustin
diff -u asterisk-1.4.21.2~dfsg/debian/control asterisk-1.4.21.2~dfsg/debian/control
--- asterisk-1.4.21.2~dfsg/debian/control
+++ asterisk-1.4.21.2~dfsg/debian/control
@@ -12,7 +13,7 @@
 Package: asterisk
 Architecture: any
 Section: comm
-Depends: ${shlibs:Depends}, asterisk-config (= ${source:Version}) | asterisk-config-custom, adduser, asterisk-sounds-main
+Depends: ${shlibs:Depends}, asterisk-config (= ${source:Version}) | asterisk-config-custom, adduser, asterisk-sounds-main, lsb-base (>= 3.2-14)
 Conflicts: asterisk-classic, asterisk-bristuff, asterisk-chan-capi (<< 1.1.1-1~)
 Replaces: asterisk-classic, asterisk-bristuff
 Provides: asterisk-1.4
diff -u asterisk-1.4.21.2~dfsg/debian/asterisk.init asterisk-1.4.21.2~dfsg/debian/asterisk.init
--- asterisk-1.4.21.2~dfsg/debian/asterisk.init
+++ asterisk-1.4.21.2~dfsg/debian/asterisk.init
@@ -46,6 +46,8 @@
 UMASK=007 # by default
 #MAXFILES=1024 # (the system default)
 
+. /lib/lsb/init-functions
+
 # by default: use real-time priority
 PARAMS=""
 CHDIR_PARM=""
@@ -125,14 +127,7 @@
 fi
 
 status() {
-	plist=`ps ax | awk "{ if (\\$5 == \"$DAEMON\") print \\$1 }"`
-	if [ "$plist" = "" ]; then
-		echo "$DESC is stopped"
-		return 1
-	else
-		echo "$DESC is running: $plist"
-		return 0
-	fi
+	status_of_proc "$DAEMON" "$DESC" && return 0 || return $?
 }
 
 asterisk_rx() {

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to