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

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

pkg/deb:

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