diff options
author | Pablo Hernan Saro <pablosaro@gmail.com> | 2010-05-12 23:31:59 +0200 |
---|---|---|
committer | David Somero <xgizzmo@slackbuilds.org> | 2010-05-12 23:31:59 +0200 |
commit | 38bec740758631ba0235fe91eb5819205e59bbf6 (patch) | |
tree | eff3aefe036f80b344c809833f9eff3f52d50201 /network/cherokee/rc.cherokee | |
parent | 499835eba52ee500f2226b7c0e5695eec62a1d27 (diff) |
network/cherokee: Added to 12.2 repository
Diffstat (limited to 'network/cherokee/rc.cherokee')
-rw-r--r-- | network/cherokee/rc.cherokee | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/network/cherokee/rc.cherokee b/network/cherokee/rc.cherokee new file mode 100644 index 000000000000..4b52f7033979 --- /dev/null +++ b/network/cherokee/rc.cherokee @@ -0,0 +1,97 @@ +#!/bin/sh +# +# Start the Cherokee Web Server. +# http://www.cherokee-project.com/ +# +# The following signals are supported by Cherokee: +# SIGHUP Restarts the server gracefully +# SIGUSR1 Restarts the server closing all the opened connections +# SIGUSR2 Reopens the log files +# SIGTERM Exits +# +# Written by Pablo Hernan Saro (pablosaro@gmail.com) + +NAME=cherokee +PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/lib/cherokee +DAEMON=/usr/sbin/cherokee +PIDFILE=/var/run/cherokee.pid +CONF=/etc/cherokee/cherokee.conf + +export PATH + +test -f $DAEMON || exit 0 + +case "$1" in + start) + echo "Starting $NAME web server..." + $DAEMON -C $CONF & + sleep 2 + echo -n "done" + ;; + + stop) + echo "Stopping $NAME web server..." + if [ -f $PIDFILE ]; then + PID=`cat $PIDFILE` + kill -s TERM $PID + sleep 4 + echo -n "done" + else + echo -n "Error: $PIDFILE does not exist." + fi + ;; + + reload) + echo "Reloading $NAME configuration" + if [ -f $PIDFILE ]; then + PID=`cat $PIDFILE` + kill -s HUP $PID + sleep 3 + echo -n "done" + else + echo -n "Error: $PIDFILE does not exist." + fi + ;; + + rotate-logs) + echo "Rotating logs" + if [ -f $PIDFILE ]; then + PID=`cat $PIDFILE` + kill -s USR2 $PID + sleep 3 + echo -n "done" + else + echo -n "Error: $PIDFILE does not exist." + fi + ;; + + restart) + echo "Restarting the server closing all the opened connections" + if [ -f $PIDFILE ]; then + PID=`cat $PIDFILE` + kill -s USR1 $PID + sleep 4 + echo -n "done" + else + echo -n "Error: $PIDFILE does not exist." + fi + ;; + + force-restart) + $0 stop + $0 start + ;; + + *) + echo "Usage: $0 {start|stop|reload|rotate-logs|restart|force-restart}" + exit 1 + ;; +esac + +if [ $? == 0 ]; then + echo . + exit 0 +else + echo failed + exit 1 +fi |