Blob Blame History Raw
#!/bin/sh
#
# cherokee       Startup script for the Apache HTTP Server
#
# chkconfig:     - 95 05
# description:   Cherokee is ligth Web Server system
# config:        /etc/cherokee/cherokee.conf
# pidfile:       /var/run/cherokee.pid
# Default-Start: 345
#

# 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
                echo -n $"$NAME: already running"
                echo ""
                exit $RETVAL
        fi
        echo -n "Starting Cherokee service: "
        $BASE -C $CONF $DAEMON pidfile $PIDFILE
        sleep 1
        action "" /sbin/pidof $NAME
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cherokee
        ;;
  stop)
        echo -n "Shutting down Cherokee service: "
        killproc $BASE
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cherokee
        ;;
  restart|reload)
        $0 stop
        $0 start
        RETVAL=$?
        ;;
  status)
        status $BASE
        RETVAL=$?
        ;;
  *)
        echo "Usage: $NAME {start|stop|restart|reload|status}"
        exit 1
esac

exit $RETVAL