]> matita.cs.unibo.it Git - helm.git/blob - helm/scripts/init.d/helm-uri-set-queue
Following an hyperlink from a proof-tree rendering now brings you to
[helm.git] / helm / scripts / init.d / helm-uri-set-queue
1 #!/bin/sh
2 #
3 # init.d script for HELM uri_set_queue.cgi
4 #
5 # by --Zack <zack@cs.unibo.it>
6 # Created: Tue,  8 Oct 2002 17:18:17 +0200
7 # Last-Modified: Wed, 20 Nov 2002 10:50:14 +0100
8
9 #DAEMON=/projects/helm/graphs/tools/uri_set_queue.cgi
10 DAEMON=/projects/helm/graphs/tools/uriSetQueue.opt
11 USAGE="Usage: /etc/init.d/helm-uri-set-queue { start | stop | restart }"
12
13 ENVSCRIPT=""
14 if [ -f /etc/default/helm ]; then
15   . /etc/default/helm
16 fi
17 if ! [ -f "$ENVSCRIPT" ]; then
18   echo "Can't find environment script '$ENVSCRIPT'"
19   exit 1
20 fi
21 . $ENVSCRIPT &> /dev/null
22
23 NAME=`basename $DAEMON`
24 PIDFILE=/projects/helm/run/$NAME.pid
25
26 do_start () {
27   echo "Starting $DAEMON ..."
28   start-stop-daemon \
29     --start --background --pidfile $PIDFILE --make-pidfile \
30     --chuid $OWNER --exec $DAEMON
31 }
32
33 do_stop () {
34   echo "Stopping $DAEMON ..."
35   start-stop-daemon --stop --pidfile $PIDFILE && \
36   (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
37 }
38
39 case "$1" in
40
41   start)
42     do_start
43     ;;
44
45   stop)
46     do_stop
47     ;;
48
49   restart)
50     do_stop
51     do_start
52     ;;
53
54   *)
55     echo "$USAGE" >&2
56     exit 1
57     ;;
58
59 esac
60