LSB conform init script (impossible?)
Martin Vogt <[email protected]>
| Newsgroups | gmane.linux.debian.devel.lsb |
|---|---|
| Message-ID | <[email protected]> |
Hello List, for me its impossible to have a single init script which works on FC/RedHat,SuSE and Debian. Is there anywhere an example of an LSB conform init script which actually _works_ ? The attached script (which is hopefully lsb conform) does not work on every distribution. Maybe I have a bug in it. SUSE 10.1/SLES Enterprise: start:ok status:ok stop:ok DEBIAN:lsb-base 3.2-13 start: ok status: ok, but the output is not helpful (* always) stop: reports no error but does not shutdown FC9: start:ok status:ok stop:ok This attached script only uses basic LSB calls, but it does not work. Has anyone a script which works on all distributions? regards, Martin
svnd
(text/plain, 964 B)
#!/bin/sh
### BEGIN INIT INFO
# Provides: svnd
# Required-Start: $syslog $remote_fs
# Should-Start: $time ypbind sendmail
# Required-Stop: $syslog $remote_fs
# Should-Stop: $time ypbind sendmail
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: The daemon
# Description: a cool daemon
### END INIT INFO
# chkconfig: 345 99 00
# description: a cool daemon
DAEMON="/usr/bin/svnserve"
PARA="--listen-port 4242 -d "
. /lib/lsb/init-functions
case "$1" in
start)
echo -n "Starting $DAEMON "
start_daemon $DAEMON $PARA
RETVAL=$?
;;
stop)
echo -n "Shutting down $DAEMON "
killproc $DAEMON -TERM
RETVAL=$?
;;
restart)
$0 stop
$0 start
;;
status)
echo -n "Checking for service $DAEMON "
pidofproc $DAEMON 2>&1 >/dev/null
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
if [ "x$RETVAL" = "x0" ] ; then
log_success_msg
else
log_failure_msg
fi