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

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

pkg/deb/init.d/jobmond:

  • more fixes: dont use --exec since process name is python
  • Property svn:executable set to *
File size: 855 bytes
RevLine 
[480]1#!/bin/sh
[430]2
3PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
[437]4DAEMON=/usr/sbin/jobmond
[430]5NAME=jobmond
6DESC="Job Monitor Daemon"
7
[480]8PIDFILE="/var/run/$NAME.pid"
[436]9
[453]10test -x $DAEMON || return 0
[430]11
[437]12OPTIONS=""
13
[436]14[ -r /etc/default/$NAME ] && . /etc/default/$NAME
[430]15
16case "$1" in
17  start)
18        echo -n "Starting $DESC: "
[480]19        start-stop-daemon --start --quiet --startas "$DAEMON" --pidfile "$PIDFILE" -- \
20                --pidfile="$PIDFILE" $OPTIONS || { echo "start failed."; exit 0; }
[430]21        echo "$NAME."
[478]22        exit 0
[430]23        ;;
24  stop)
25        echo -n "Stopping $DESC: "
[480]26        start-stop-daemon --stop  --quiet --pidfile "$PIDFILE" \
[478]27                --signal 9 2>&1 > /dev/null || { rm -f "$PIDFILE"; echo "not running."; exit 0; }
[430]28        echo "$NAME."
[436]29        rm -f "$PIDFILE"
30        exit 0
[430]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.