#!/bin/sh # # perlbal Perlbal - Reverse-proxy load balancer and webserver # # chkconfig: 345 86 13 # # description: Perlbal - Reverse-proxy load balancer and webserver # # processname: perlbal # # $Id$ # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network [ -f /etc/sysconfig/perlbal ] && . /etc/sysconfig/perlbal # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then msg_network_down perlbal exit 1 fi else exit 0 fi start() { # Check if the service is already running? if [ ! -f /var/lock/subsys/perlbal ]; then msg_starting perlbal daemon perlbal $PERLBAL_OPTS RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/perlbal else msg_already_running perlbal fi } stop() { if [ -f /var/lock/subsys/perlbal ]; then # Stop daemons. msg_stopping perlbal killproc perlbal rm -f /var/lock/subsys/perlbal else msg_not_running perlbal fi } condrestart() { if [ -f /var/lock/subsys/perlbal ]; then stop start else msg_not_running perlbal RETVAL=$1 fi } reload() { if [ -f /var/lock/subsys/perlbal ]; then msg_reloading perlbal killproc perlbal -HUP RETVAL=$? else msg_not_running perlbal RETVAL=7 fi } RETVAL=0 # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; try-restart) condrestart 0 ;; reload|force-reload) reload ;; status) status perlbal RETVAL=$? ;; *) msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}" exit 3 esac exit $RETVAL