root/cherokee/trunk/contrib/cherokee

Revision 2050, 1.2 kB (checked in by alo, 2 months ago)

--

Line 
1 #! /bin/bash
2 #
3 # cherokee      Start the cherokee HTTP server.
4 #
5
6 NAME=cherokee
7 PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/lib/cherokee
8 DAEMON=/usr/local/sbin/cherokee
9 PIDFILE=/var/run/$NAME.pid
10 CONF=/usr/local/etc/cherokee/cherokee.conf
11
12 trap "" 1
13 export LANG=C
14 export PATH
15
16 test -f $DAEMON || exit 0
17
18 case "$1" in
19   start)
20     echo -n "Starting cherokee web server: $NAME"
21     start-stop-daemon --start -b --exec $DAEMON
22     ;;
23
24   stop)
25     echo -n "Stopping cherokee web server: $NAME"
26     start-stop-daemon --stop --pidfile $PIDFILE --oknodo --signal TERM --exec $DAEMON --retry 30
27     ;;
28
29   reload)
30     echo -n "Reloading $NAME configuration"
31     start-stop-daemon --stop --pidfile $PIDFILE --signal HUP
32     ;;
33
34   rotate-logs)
35     echo -n "Rotating logs"
36     start-stop-daemon --stop --pidfile $PIDFILE --signal USR2
37     ;;
38
39   restart)
40     echo -n "Restarting the server closing all the opened connections"
41     start-stop-daemon --stop --pidfile $PIDFILE --signal USR1
42     ;;
43
44   force-restart)
45     $0 stop
46     $0 start
47     ;;
48
49   *)
50     echo "Usage: /etc/init.d/$NAME {start|stop|reload|rotate-logs|restart|force-restart}"
51     exit 1
52     ;;
53 esac
54
55 if [ $? == 0 ]; then
56         echo .
57         exit 0
58 else
59         echo failed
60         exit 1
61 fi
Note: See TracBrowser for help on using the browser.