]> matita.cs.unibo.it Git - helm.git/blob - helm/scripts/init.d/helm-uwobo_mowgli
added 2 seconds delay before loading stylesheets
[helm.git] / helm / scripts / init.d / helm-uwobo_mowgli
1 #!/bin/sh
2 #
3 # init.d script for http_getter
4 #
5 # by --Zack <zack@cs.unibo.it>
6 # Created: Wed, 15 Jan 2003 15:14:07 +0100
7 # Last-Modified: Fri, 17 Jan 2003 16:46:41 +0100
8
9 DAEMON="/projects/helm/uwobo_mowgli/uwobo"
10 USAGE="Usage: /etc/init.d/helm-uwobo_mowgli { start | stop | restart }"
11
12 ENVSCRIPT=""
13 if [ -f /etc/default/helm_mowgli ]; then
14   . /etc/default/helm_mowgli
15 fi
16 if ! [ -f "$ENVSCRIPT" ]; then
17   echo "Can't find environment script '$ENVSCRIPT'"
18   exit 1
19 fi
20 . $ENVSCRIPT &> /dev/null
21
22 NAME=`basename $DAEMON`
23 PIDFILE=/projects/helm/run/"$NAME"_mowgli.pid
24
25 do_start () {
26   echo "Starting $DAEMON ..."
27   start-stop-daemon \
28     --start --background --pidfile $PIDFILE --make-pidfile \
29     --chuid $OWNER --exec $DAEMON
30   echo "Waiting for UWOBO to startup (2 seconds) ..."
31   sleep 2
32   /etc/init.d/helm-tomcat_mowgli start
33 }
34
35 do_stop () {
36   echo "Stopping $DAEMON ..."
37   start-stop-daemon --stop --pidfile $PIDFILE && \
38   (if [ -f $PIDFILE ]; then rm -f $PIDFILE; else true; fi)
39 }
40
41 case "$1" in
42
43   start)
44     do_start
45     ;;
46
47   stop)
48     do_stop
49     ;;
50
51   restart)
52     do_stop
53     do_start
54     ;;
55
56   *)
57     echo "$USAGE" >&2
58     exit 1
59     ;;
60
61 esac
62