adapt init scripts to LSB 3.x

This commit is contained in:
marschap
2006-10-06 16:07:18 +00:00
parent 8a890ce726
commit 9090460dc1
5 changed files with 105 additions and 69 deletions
+26 -17
View File
@@ -1,12 +1,23 @@
#! /bin/sh
#
# /etc/init.d/LCDd lcdproc server starting and stopping
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
#### BEGIN INIT INFO
# Provides: LCDd
# Required-Start: $syslog $local_fs $network $remote_fs
# Required-Stop: $syslog $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: LCDproc Server Daemon
# Description: Debian init script for LCDd, the display
# server daemon in the LCDproc suite
### END INIT INFO
set -e
# local variables
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/LCDd
NAME=LCDd
DESC="LCDproc server daemon"
DESC="LCDproc display server daemon"
DEFAULTS=/etc/default/$NAME
# Source defaults file; edit that file to configure this script.
@@ -24,22 +35,22 @@ if [ -z "${OPTIONS}" ]; then
OPTIONS="-c /etc/lcdproc/LCDd.conf"
fi
# sanity check
test -x $DAEMON || exit 0
set -e
# load LSB 3.x init functions
. /lib/lsb/init-functions
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet \
--exec $DAEMON -- $OPTIONS
echo "$NAME."
log_daemon_msg "Starting $DESC" "$NAME"
start_daemon $DAEMON $OPTIONS
log_end_msg $?
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --oknodo --quiet \
--exec $DAEMON
echo "$NAME."
log_daemon_msg "Stopping $DESC" "$NAME"
killproc $DAEMON
log_end_msg $?
;;
restart|reload|force-reload)
$0 stop
@@ -47,9 +58,7 @@ case "$1" in
$0 start
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac