#! /bin/sh # # Start/stop Cherokee web server ### BEGIN INIT INFO # Provides: cherokee # Required-Start: $network # Required-Stop: $network # Should-Start: $named # Should-Stop: $named # Default-Start: S 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start the Cherokee Web server # Description: Start the Cherokee Web server ### END INIT INFO # Source function library . /etc/rc.d/init.d/functions NAME=cherokee BASE=/usr/sbin/$NAME DAEMON="-d" CONF="/etc/cherokee/cherokee.conf" PIDFILE="/var/run/$NAME.pid" # Check that $BASE exists. [ -f $BASE ] || exit 0 # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 RETVAL=0 # See how we were called. case "$1" in start) if [ -n "`/sbin/pidof $NAME`" ]; then grpintf "%s: already running" "$NAME" gprintf "\n" exit $RETVAL fi gprintf "Starting %s service: " "Cherokee" $BASE --config=$CONF $DAEMON pidfile $PIDFILE >&/dev/null /sbin/pidof $NAME >&/dev/null && success || failure RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cherokee ;; stop) gprintf "Stutting down %s service: " "Cherokee" killproc $BASE RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cherokee ;; restart|reload) $0 stop $0 start RETVAL=$? ;; status) status $BASE RETVAL=$? ;; *) gprintf "Usage: %s {start|stop|restart|reload|status}" "$NAME" exit 1 esac exit $RETVAL