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

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

deb/init.d/jobmond:

  • cleanup
  • Property svn:executable set to *
File size: 854 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/$NAME.pid"
9
10test -x $DAEMON || return 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 --startas "$DAEMON" --pidfile "$PIDFILE" -- \
20                --pidfile="$PIDFILE" $OPTIONS || { echo "start failed."; exit 0; }
21        echo "$NAME."
22        exit 0
23        ;;
24  stop)
25        echo -n "Stopping $DESC: "
26        start-stop-daemon --stop --quiet --pidfile "$PIDFILE" \
27                --signal 9 2>&1 > /dev/null || { rm -f "$PIDFILE"; echo "not running."; exit 0; }
28        echo "$NAME."
29        rm -f "$PIDFILE"
30        exit 0
31        ;;
32  restart|force-reload)
33        $0 stop
34        $0 start
35        ;;
36  *)
37        echo "Usage: $N {start|stop|restart}" >&2
38        exit 1
39        ;;
40esac
41
42exit 0
Note: See TracBrowser for help on using the repository browser.