Package: postfix-gld
Version: 1.7-2
Severity: wishlist
Tags: patch

attached, you will find a patch for /etc/init.d/gld to add a status
parameter.

please consider adding something like this to postfix-gld.

cheers,
raoul
-- 
____________________________________________________________________
DI (FH) Raoul Bhatia M.Sc.          email.          [email protected]
Technischer Leiter

IPAX - Aloy Bhatia Hava OEG         web.          http://www.ipax.at
Barawitzkagasse 10/2/2/11           email.            [email protected]
1190 Wien                           tel.               +43 1 3670030
FN 277995t HG Wien                  fax.            +43 1 3670030 15
____________________________________________________________________

diff -r 2e80309c4386 init.d/gld
--- a/etc/init.d/gld        Thu Jun 04 19:26:57 2009 +0200
+++ b/etc/init.d/gld        Tue Aug 11 14:17:02 2009 +0200
@@ -29,6 +29,13 @@
   exit 0
 fi
 
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
 case "$1" in
   start)
         echo -n "Starting $DESC: $NAME"
@@ -40,8 +47,8 @@
   stop)
         # start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
         #       --exec $DAEMON
-       pid=`ps ax | awk '$5 == "/usr/sbin/gld" { print $1 }'`
-       if [ "$pid" ]; then
+        pid=`ps ax | awk '$5 == "/usr/sbin/gld" { print $1 }'`
+        if [ "$pid" ]; then
           echo -n "Stopping $DESC: $NAME"
           kill $pid
           echo "."
@@ -59,7 +66,15 @@
           echo "done."
         else
           echo "No gld daemon found"
-       fi
+        fi
+        ;;
+  status)
+        pid=`ps ax | awk '$5 == "/usr/sbin/gld" { print $1 }'`
+        if [ "$pid" ]; then
+          log_begin_msg "Checking $DESC: $NAME ... "
+          kill -0 $pid && exit 0
+        fi
+        exit 3
         ;;
   restart)
         # start-stop-daemon --stop --quiet --pidfile \
@@ -72,7 +87,7 @@
         ;;
   *)
         N=/etc/init.d/$NAME
-        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+        echo "Usage: $N {start|stop|status|restart|reload|force-reload}" >&2
         exit 1
         ;;
 esac


Reply via email to