3 # cherokee Start the cherokee HTTP server.
7 # description: Cherokee is Fast, Flexible and Lightweight Web server
11 # Source function library
12 . /etc/rc.d/init.d/functions
15 . /etc/sysconfig/network
17 # Get service config - may override defaults
18 [ -f /etc/sysconfig/cherokee ] && . /etc/sysconfig/cherokee
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network ]; then
23 msg_network_down "Cherokee Web Server"
30 # See how we were called.
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/cherokee ]; then
35 msg_starting "Cherokee Web Server"
37 # it offers no stdout/stderr logging. workaround
38 exec 2>>/var/log/cherokee/cherokee.log
40 start-stop-daemon --start --exec /usr/sbin/cherokee --pidfile /var/run/cherokee.pid -- -b
43 if [ $RETVAL -eq 0 ]; then
44 # the pidfile written is wrong when cherokee -b is used. damn
45 pid=$(/sbin/pidof cherokee)
46 echo $pid > /var/run/cherokee.pid
47 touch /var/lock/subsys/cherokee
53 msg_already_running "Cherokee Web Server"
57 if [ -f /var/lock/subsys/cherokee ]; then
59 msg_stopping "Cherokee Web Server"
60 start-stop-daemon --stop --pidfile /var/run/cherokee.pid --oknodo --exec /usr/sbin/cherokee
62 if [ $RETVAL -eq 0 ]; then
63 rm -f /var/run/cherokee.pid /var/lock/subsys/cherokee >/dev/null 2>&1
69 msg_not_running "Cherokee Web Server"
82 msg_usage "$0 {start|stop|restart|force-reload|status}"
88 # This must be last line !