source: trunk/pkg/deb/init.d/jobarchived @ 430

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

bla

  • Property svn:executable set to *
File size: 903 bytes
Line 
1#! /bin/sh
2
3PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
4DAEMON=/usr/bin/jobarchived
5NAME=jobarchived
6DESC="Job Archive Daemon"
7
8export PYTHONPATH=/usr/share/jobarchived:$PYTHONPATH
9
10test -x $DAEMON || exit 0
11
12set -e
13
14case "$1" in
15  start)
16        echo -n "Starting $DESC: "
17        start-stop-daemon --start --quiet -m --pidfile /var/run/$NAME.pid \
18                --exec $DAEMON
19        sleep 1
20        ps -ef | grep jobarchived$ | awk '{ print $2 }' >/var/run/$NAME.pid
21        echo "$NAME."
22        ;;
23  stop)
24        echo -n "Stopping $DESC: "
25        start-stop-daemon --stop  --quiet --oknodo --name $DAEMON \
26                2>&1 > /dev/null
27        sleep 1
28        test -f /var/run/$NAME.pid && MYPID=`cat /var/run/$NAME.pid`
29        test ! -z $MYPID && ps $MYPID 2>&1 > /dev/null && kill -9 $MYPID 2>&1 > /dev/null
30        echo "$NAME."
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.