source: trunk/pkg/deb/init.d/jobarchived @ 479

Last change on this file since 479 was 479, checked in by bastiaans, 16 years ago

pkg/deb/init.d/jobarchived:

  • fix
  • Property svn:executable set to *
File size: 880 bytes
RevLine 
[430]1#! /bin/sh
2
3PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
[437]4DAEMON=/usr/sbin/jobarchived
[430]5NAME=jobarchived
[437]6DESC="Job Archiving Daemon"
[430]7
[437]8PIDFILE="/var/run/jobarchived.pid"
9OPTIONS=""
[430]10
11test -x $DAEMON || exit 0
12
[437]13[ -r /etc/default/$NAME ] && . /etc/default/$NAME
[430]14
15case "$1" in
16  start)
17        echo -n "Starting $DESC: "
[437]18        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
[479]19                --exec $DAEMON -- --pidfile "$PIDFILE" $OPTIONS || { echo "start failed."; exit 0; }
[430]20        echo "$NAME."
[479]21        exit 0
[430]22        ;;
23  stop)
24        echo -n "Stopping $DESC: "
[437]25        start-stop-daemon --stop  --quiet --pidfile /var/run/$NAME.pid \
[479]26                --signal 9 2>&1 > /dev/null || { rm -f "$PIDFILE"; echo "not running."; exit 0; }
[430]27        echo "$NAME."
[437]28        rm -f "$PIDFILE"
29        exit 0
[430]30        ;;
31  restart|force-reload)
32        $0 stop
33        $0 start
34        ;;
35  *)
36        echo "Usage: $N {start|stop|restart}" >&2
37        exit 1
38        ;;
39esac
40
41exit 0
Note: See TracBrowser for help on using the repository browser.