Subversion Repositories general

Rev

Blame | Last modification | View Log | RSS feed

#! /bin/sh
set -e

# /etc/init.d/rebootd: start and stop the reboot daemon

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"

case "$1" in
  start)
        echo -n "Starting rebootd"
        start-stop-daemon --start --quiet --pidfile /var/run/rebootd.pid \
                --exec /usr/local/sbin/rebootd -- --config /etc/rebootd.conf
        echo "."
        ;;
  stop)
        echo -n "Stopping rebootd"
        start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/rebootd.pid
        echo "."
        ;;

  reload|force-reload)
        echo -n "Reloading rebootd configuration"
        start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/rebootd.pid \
                --exec /usr/local/sbin/rebootd -- --config /etc/rebootd.conf
        echo "."
        ;;

  restart)
        echo -n "Restarting rebootd"
        start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/rebootd.pid
        start-stop-daemon --start --quiet --pidfile /var/run/rebootd.pid \
                --exec /usr/local/sbin/rebootd -- --config /etc/rebootd.conf
        echo "."
        ;;

  *)
        echo "Usage: /etc/init.d/rebootd {start|stop|reload|force-reload|restart}"
        exit 1
esac

exit 0