On Mon, Feb 13, 2006 at 01:22:21PM +0100, Florian Schmidt wrote:
> > echo '/usr/local/sbin/das_watchdog & >/dev/null' >>/etc/rc.local
> 
> This assumes an initscript style that's not used on all linux systems. 

i've attached a simple /etc/init.d script; on debian you can
do:

# cp das_watchdog /etc/init.d/
# update-rc.d das_watchdog defaults
# invoke-rc.d das_watchdog start

<sk>
#! /bin/sh
#
#               Written by Miquel van Smoorenburg <[EMAIL PROTECTED]>.
#               Modified for Debian GNU/Linux
#               by Ian Murdock <[EMAIL PROTECTED]>.
#               Modified for das_watchdog by <sk>

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/das_watchdog
NAME=das_watchdog
DESC="Watchdog"

test -x $DAEMON || exit 0

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        start-stop-daemon --start --quiet --background --exec $DAEMON
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
        echo "."
        ;;
  restart|reload|force-reload)
        echo -n "Restarting $DESC: $NAME... "
        start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
        start-stop-daemon --start --quiet --background --exec $DAEMON
        echo "done."
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
        exit 1
        ;;
esac

exit 0

Reply via email to