Package: rplay
Version: N/A
Severity: wishlist
Tags: patch

This bug report is part of the "bubulle mini campaign to help the switch to
LSB-enabled init scripts". Please consider that I am definitely not a wizard
with regard of the LSB init scripts and you might need to get more advice
from the sysvinit package maintainers.

I just went on your package....because it is installed on my system and
using the attached patch makes the init of your package nicer on my
system..:-)

Using LSB-enabled scripts allows for more control of parallel execution of
these scripts and, as a nice side effect, helps improving the visual aspect
of the system boot.

More information is available on http://wiki.debian.org/LSBInitScripts
and http://initscripts-ng.alioth.debian.org/soc2006-bootsystem/. You
can also contact sysvinit wizards on #pkg-sysvinit on irc.debian.org.

The attached patch is an attempt that should help you switching your package
to LSB scripts. Please don't take it as Holy Word.....I bet it can be
enhanced..


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.17-2-686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to fr_FR.UTF-8)
--- rplay-server.rplay.ori      2006-09-23 19:55:28.999755540 +0200
+++ rplay-server.rplay  2006-09-23 20:02:20.538901233 +0200
@@ -1,5 +1,13 @@
 #!/bin/sh
 
+### BEGIN INIT INFO
+# Provides:          rplayd
+# Required-Start:    $network $local_fs $remote_fs
+# Required-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+### END INIT INFO
+#
 # /etc/init.d/rplay: start and stop the rplay daemon
 
 # there have been requests to have rplay start up *late* and stop *early*
@@ -7,21 +15,29 @@
 
 test -x /usr/sbin/rplayd || exit 0
 
+. /lib/lsb/init-functions
+
 if egrep "^rplay" /etc/inetd.conf > /dev/null; then
-    echo "RPlayd is currently started from inetd"
+    log_warning_msg "RPlayd is currently started from inetd"
     exit 0
 fi
 
 case "$1" in
-start) echo -n "Starting rplay server: rplayd"
-       start-stop-daemon --start --quiet \
-                --exec /usr/sbin/rplayd > /dev/null 2>&1
-       echo "."
+start) log_begin_msg "Starting rplay server" "rplayd"
+       if start-stop-daemon --start --quiet \
+                --exec /usr/sbin/rplayd > /dev/null 2>&1; then
+               log_end_msg 0
+       else
+               log_end_msg 1
+       fi
        ;;
 
-stop)  echo -n "Stopping rplay server: rplayd"
-       start-stop-daemon --stop --quiet --exec /usr/sbin/rplayd
-       echo "."
+stop)  log_begin_msg "Stopping rplay server" "rplayd"
+       if start-stop-daemon --stop --quiet --exec /usr/sbin/rplayd; then
+               log_end_msg 0
+       else
+               log_end_msg 1
+       fi
        ;;
     
 reload|force-reload)
@@ -29,15 +45,18 @@
        ;;
 
 restart)
-       echo -n "Restarting rplay server: rplayd"
+       log_begin_msg "Restarting rplay server" "rplayd"
        start-stop-daemon --stop --quiet --exec /usr/sbin/rplayd
-       start-stop-daemon --start --quiet \
-                --exec /usr/sbin/rplayd > /dev/null 2>&1
-       echo "."
+       if start-stop-daemon --start --quiet \
+                --exec /usr/sbin/rplayd > /dev/null 2>&1; then
+               log_end_msg 0
+       else
+               log_end_msg 1
+       fi
        ;;
 
 *)
-       echo "Usage: /etc/init.d/rplay {start|stop|reload}" >&2
+       log_failure_msg "Usage: /etc/init.d/rplay {start|stop|reload}"
        exit 1
        ;;
 esac

Reply via email to