You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

79 lines
1.4 KiB

#!/bin/sh
#
# haproxy
#
# chkconfig: - 85 15
# description: HAProxy is a free, very fast and reliable solution \
# offering high availability, load balancing, and \
# proxying for TCP and HTTP-based applications
# processname: haproxy
# config: /etc/kazoo/haproxy/haproxy.cfg
# pidfile: /var/run/kazoo-haproxy.pid
RETVAL=0
LOCK_FILE=/var/lock/subsys/kazoo-haproxy
. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
[ "$NETWORKING" = "no" ] && exit 0
start() {
RETVAL=1
echo -n $"Starting HAProxy: "
/usr/sbin/kazoo-haproxy start
RETVAL=$?
echo
[ ${RETVAL} -eq 0 ] && touch ${LOCK_FILE}
}
stop() {
RETVAL=1
echo -n $"Stopping HAProxy: "
/usr/sbin/kazoo-haproxy stop
RETVAL=$?
if [ ${RETVAL} -eq 0 ]; then
rm -f ${LOCK_FILE} ${pidfile}
success
else
failure
fi
echo
}
status() {
/usr/sbin/kazoo-haproxy status
RETVAL=$?
}
restart() {
stop
start
}
case "$1" in
start|stop|restart|reload)
$1
;;
force-reload)
restart
;;
reload)
/usr/sbin/kazoo-haproxy reload
check)
/usr/sbin/kazoo-haproxy check
;;
status)
/usr/sbin/kazoo-haproxy status
;;
condrestart|try-restart)
[ ! -f $lockfile ] || restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
RETVAL=1
esac
exit ${RETVAL}