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

Last change on this file since 436 was 436, checked in by bastiaans, 15 years ago

pkg/deb/init.d/jobmond:

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