Logo Search packages:      
Sourcecode: odccm version File versions  Download package

init.d

#!/bin/sh

### BEGIN INIT INFO
# Provides:        odccm
# Required-Start:  $network $syslog hal dbus
# Required-Stop:   $network $syslog
# Default-Start:   2 3 4 5
# Default-Stop:    0 1 6
# Short-Description: Start odccm daemon
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

. /lib/lsb/init-functions

NAME=odccm
DAEMON=/usr/sbin/odccm
PIDFILE=/var/run/odccm.pid
DESC="odccm"
DAEMON_ARGS="-f"

test -x $DAEMON || exit 5

if [ -r /etc/default/$NAME ]; then
      . /etc/default/$NAME
fi

case $1 in
      start)
            log_daemon_msg "Starting $DESC" $NAME
            start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --make-pidfile --background --exec $DAEMON -- $DAEMON_ARGS
            log_end_msg $?
            ;;
      stop)
            log_daemon_msg "Stopping $DESC" $NAME
            start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
            log_end_msg $?
            ;;
      restart|force-reload)
            $0 stop && sleep 2 && $0 start
            ;;
      try-restart)
            if $0 status >/dev/null; then
                  $0 restart
            else
                  exit 0
            fi
            ;;
      reload)
            exit 3
            ;;
      status)
            pidofproc -p $PIDFILE $DAEMON >/dev/null
            status=$?
            if [ $status -eq 0 ]; then
                  log_success_msg "$DESC is running."
            else
                  log_failure_msg "$DESC is not running."
            fi
            exit $status
            ;;
      *)
            echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
            exit 2
            ;;
esac

Generated by  Doxygen 1.6.0   Back to index