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

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

pkg/deb/init.d/jobmond:

  • working init.d script
  • Property svn:executable set to *
File size: 839 bytes
RevLine 
[430]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
[436]8PIDFILE="/var/run/jobmond.pid"
9
[430]10test -x $DAEMON || exit 0
11
[436]12[ -r /etc/default/$NAME ] && . /etc/default/$NAME
[430]13
14case "$1" in
15  start)
16        echo -n "Starting $DESC: "
[436]17        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
18                --exec $DAEMON -- --pidfile "$PIDFILE" || { echo " start failed."; exit 1; }
[430]19        echo "$NAME."
20        ;;
21  stop)
22        echo -n "Stopping $DESC: "
[436]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; }
[430]25        echo "$NAME."
[436]26        rm -f "$PIDFILE"
27        exit 0
[430]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.