Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 64 lines (53 sloc) 1.28 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
#! /bin/bash
#
# cherokee:
# Start the Cherokee Web Server.
#
# http://www.cherokee-project.com/
#

NAME=cherokee
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/lib/cherokee
DAEMON=%sbindir%/cherokee
PIDFILE=%localstatedir%/run/$NAME.pid
CONF=%sysconfdir%/cherokee/cherokee.conf

trap "" 1
export LANG=C
export PATH

test -f $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting cherokee web server: $NAME"
    start-stop-daemon --start -b --exec $DAEMON
    ;;

  stop)
    echo -n "Stopping cherokee web server: $NAME"
    start-stop-daemon --stop --pidfile $PIDFILE --oknodo --signal TERM --exec $DAEMON --retry 30
    ;;

  reload)
    echo -n "Reloading $NAME configuration"
    start-stop-daemon --stop --pidfile $PIDFILE --signal HUP
    ;;

  rotate-logs)
    echo -n "Rotating logs"
    start-stop-daemon --stop --pidfile $PIDFILE --signal USR2
    ;;

  restart)
    echo -n "Restarting the server closing all the opened connections"
    start-stop-daemon --stop --pidfile $PIDFILE --signal USR1
    ;;

  force-restart)
    $0 stop
    $0 start
    ;;

  *)
    echo "Usage: %sysconfdir%/init.d/$NAME {start|stop|reload|rotate-logs|restart|force-restart}"
    exit 1
    ;;
esac

if [ $? == 0 ]; then
echo .
exit 0
else
echo failed
exit 1
fi
Something went wrong with that request. Please try again.