]> git.pld-linux.org Git - packages/cherokee.git/blobdiff - cherokee.init
- implement force-reload as restart (force-reload is mandatory and can restart servic...
[packages/cherokee.git] / cherokee.init
index e52bdde25fe9a2c9e4682b12f03e31a761bf27ea..df645cf014381e6e3497f013dfc3b34b5714ccc0 100644 (file)
@@ -33,9 +33,17 @@ case "$1" in
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/cherokee ]; then
                msg_starting "Cherokee Web Server"
-               start-stop-daemon --start --exec /usr/sbin/cherokee --background --pidfile /var/run/cherokee.pid
+               (
+               # it offers no stdout/stderr logging. workaround
+               exec 2>>/var/log/cherokee/cherokee.log
+               exec 1>&2
+               start-stop-daemon --start --exec /usr/sbin/cherokee --pidfile /var/run/cherokee.pid -- -b
+               )
                RETVAL=$?
                if [ $RETVAL -eq 0 ]; then
+                       # the pidfile written is wrong when cherokee -b is used. damn
+                       pid=$(/sbin/pidof cherokee)
+                       echo $pid > /var/run/cherokee.pid
                        touch /var/lock/subsys/cherokee
                        ok
                else
@@ -61,31 +69,17 @@ case "$1" in
                msg_not_running "Cherokee Web Server"
        fi
        ;;
-  restart)
+  restart|force-reload)
        $0 stop
        $0 start
        exit $?
        ;;
-  reload)
-       if [ -f /var/lock/subsys/cherokee ]; then
-               msg_reloading "Cherokee Web Server"
-               start-stop-daemon --stop --pidfile /var/run/cherokee.pid --signal HUP
-               RETVAL=$?
-       else
-               msg_not_running "Cherokee Web Server" >&2
-               RETVAL=7
-       fi
-       ;;
-  force-reload)
-       $0 reload
-       exit $?
-       ;;
   status)
        status cherokee
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|status}"
        exit 3
 esac
 
This page took 0.090512 seconds and 4 git commands to generate.