A new user interface for you! Read more...

File chef-server-webui.init of Package rubygem-chef-server-webui

#!/bin/bash
#
# chef-server-webui Startup script for chef-server-webui
#
# chkconfig: - 98 02
# description: Server WebUI component of the Chef systems integration framework.

### BEGIN INIT INFO
# Provides: chef-server-webui
# Required-Start: $local_fs $network $remote_fs chef-server
# Required-Stop: $local_fs $network $remote_fs chef-server
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Should-Start: $named $time
# Should-Stop: $named $time
# Short-Description: Startup script for chef-server-webui
# Description: Server WebUI component of the Chef systems integration framework.
### END INIT INFO

# Source function library
. /etc/rc.status

exec="/usr/bin/chef-server-webui"
prog="chef-server-webui"

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

config=${CONFIG-/etc/chef/webui.rb}
pidfile=${PIDFILE-/var/run/chef/server-webui.%s.pid}
mainpid=${MAINPID-/var/run/chef/server-webui.main.pid}
logfile=${LOGFILE-/var/log/chef/webui.log}
options=${OPTIONS-}
port=${PORT-4040}

DAEMON_OPTS="-p $port -e production -d -a thin -P $pidfile -L $logfile -C $config -u chef -G chef"

case "$1" in
    start)
	echo -n $"Starting $prog: "
        if [ ! -d /var/run/chef ]; then
            mkdir -p /var/run/chef
            chmod 0750 /var/run/chef
            chown chef:chef /var/run/chef
        fi

	startproc -q $exec $DAEMON_OPTS
	# As with rubygem-chef startup, need to double-check it's actually
	# running before we return success.
        for i in 1 2 3 4 5 ; do
		sleep 1
                rc_reset
                checkproc -p $mainpid $prog
                rc_status && break
        done
	rc_status -v
        ;;
    stop)
	echo -n $"Stopping $prog: "
	killproc $prog -p "$mainpid"
        rc_status -v
        ;;
    restart)
	$0 start
	$0 stop
        ;;
    reload)
        ;;
    force-reload)
        force_reload
        ;;
    status)
	echo -n $"Checking $prog: "
        checkproc -p $mainpid $prog
        rc_status -v
        ;;
    condrestart|try-restart)
        $0 status
        if test $? = 0; then
                $0 restart
        else
                rc_reset        # Not running is not a failure.
        fi
        # Remember status and be quiet
        rc_status
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
        exit 2
esac
exit $?