source: trunk/pkg/deb/init.d/jobmond @ 442

Last change on this file since 442 was 442, checked in by bastiaans, 17 years ago
  • pkg bla
  • Property svn:executable set to *
File size: 859 bytes
Line 
1#! /bin/sh
2
3PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
4DAEMON=/usr/sbin/jobmond
5NAME=jobmond
6DESC="Job Monitor Daemon"
7
8PIDFILE="/var/run/jobmond.pid"
9
10test -x $DAEMON || exit 0
11
12OPTIONS=""
13
14[ -r /etc/default/$NAME ] && . /etc/default/$NAME
15
16case "$1" in
17  start)
18        echo -n "Starting $DESC: "
19        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
20                --exec $DAEMON -- --pidfile "$PIDFILE" $OPTIONS || { echo "start failed."; exit 0; }
21        echo "$NAME."
22        ;;
23  stop)
24        echo -n "Stopping $DESC: "
25        start-stop-daemon --stop  --quiet --pidfile /var/run/$NAME.pid \
26                --signal 9 2>&1 > /dev/null || { rm -f "$PIDFILE"; echo "not running."; exit 0; }
27        echo "$NAME."
28        rm -f "$PIDFILE"
29        exit 0
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.