[Pkg-voip-commits] r6764 - in /iaxmodem/trunk/debian: changelog iaxmodem.init

jblache at alioth.debian.org jblache at alioth.debian.org
Sun Feb 15 16:59:45 UTC 2009


Author: jblache
Date: Sun Feb 15 16:59:45 2009
New Revision: 6764

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=6764
Log:
Add the status action to the initscript.

Modified:
    iaxmodem/trunk/debian/changelog
    iaxmodem/trunk/debian/iaxmodem.init

Modified: iaxmodem/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/iaxmodem/trunk/debian/changelog?rev=6764&op=diff
==============================================================================
--- iaxmodem/trunk/debian/changelog (original)
+++ iaxmodem/trunk/debian/changelog Sun Feb 15 16:59:45 2009
@@ -1,12 +1,13 @@
 iaxmodem (1.1.1~dfsg-3) UNRELEASED; urgency=low
 
   [ Julien BLACHE ]
-  * NOT RELEASED YET
+  * debian/iaxmodem.init:
+    + Added status action (closes: #498219).
 
   [ Victor Seva ]
   * changed debian/watch file.
 
- -- Julien BLACHE <jblache at debian.org>  Wed, 30 Jul 2008 19:52:33 +0200
+ -- Julien BLACHE <jblache at debian.org>  Sun, 15 Feb 2009 17:58:50 +0100
 
 iaxmodem (1.1.1~dfsg-2) unstable; urgency=low
 

Modified: iaxmodem/trunk/debian/iaxmodem.init
URL: http://svn.debian.org/wsvn/pkg-voip/iaxmodem/trunk/debian/iaxmodem.init?rev=6764&op=diff
==============================================================================
--- iaxmodem/trunk/debian/iaxmodem.init (original)
+++ iaxmodem/trunk/debian/iaxmodem.init Sun Feb 15 16:59:45 2009
@@ -55,9 +55,29 @@
 		/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
 	echo "$NAME."
 	;;
+  status)
+	if [ -s /var/run/$NAME.pid ]; then
+	    RUNNING=$(cat /var/run/$NAME.pid)
+	    if [ -d /proc/$RUNNING ]; then
+		if [ $(readlink /proc/$RUNNING/exe) = $DAEMON ]; then
+		    echo "$NAME is running."
+		    exit 0
+		fi
+	    fi
+
+	    # No such PID, or executables don't match
+	    echo "$NAME is not running, but pidfile existed."
+	    rm /var/run/$NAME.pid
+	    exit 1
+	else
+	    rm -f /var/run/$NAME.pid
+	    echo "$NAME not running."
+	    exit 1
+	fi
+	;;
   *)
 	N=/etc/init.d/$NAME
-	echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
 	exit 1
 	;;
 esac




More information about the Pkg-voip-commits mailing list