Package: yate
Version: 1.3.0-1
Severity: minor

Debian init script doesn't support status command


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/2 CPU cores)
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ANSI_X3.4-1968) (ignored: 
LC_ALL set to C)
Shell: /bin/sh linked to /bin/bash

Versions of packages yate depends on:
ii  adduser                       3.107      add and remove users and groups
ii  libc6                         2.7-10     GNU C Library: Shared libraries
ii  libgcc1                       1:4.3.0-2  GCC support library
ii  libgsm1                       1.0.12-1   Shared libraries for GSM speech co
pn  libpri1.0                     <none>     (no description available)
ii  libspeex1                     1.1.12-3   The Speex Speech Codec
ii  libstdc++6                    4.3.0-2    The GNU Standard C++ Library v3
pn  libyate1.3.0                  <none>     (no description available)

Versions of packages yate recommends:
pn  php4-cli | php5-cli           <none>     (no description available)

*** yate.init.patch
--- yate-1.3.0-1.dfsg/debian/yate.init  2008-04-02 15:14:53.000000000 +0200
+++ yate.init   2008-04-02 15:14:30.000000000 +0200
@@ -70,9 +70,25 @@
                 --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
+  status)
+       echo -n "Status of $DESC: "
+
+       if [ ! -r "$PIDFILE" ]; then
+               echo "$NAME is not running."
+               exit 3
+       fi
+
+       if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then
+               echo "$NAME is running."
+               exit 0
+       else
+               echo "$NAME is not running but $PIDFILE exists."
+               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
--- yate-1.3.0-1.dfsg/debian/yate.init  2008-04-02 15:14:53.000000000 +0200
+++ yate.init   2008-04-02 15:14:30.000000000 +0200
@@ -70,9 +70,25 @@
                 --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
+  status)
+       echo -n "Status of $DESC: "
+
+       if [ ! -r "$PIDFILE" ]; then
+               echo "$NAME is not running."
+               exit 3
+       fi
+
+       if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then
+               echo "$NAME is running."
+               exit 0
+       else
+               echo "$NAME is not running but $PIDFILE exists."
+               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

Reply via email to