#!/bin/sh
# chkconfig 2345 on
# description: HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
config="/usr/local/haproxy/conf/haproxy.cfg"
exec="/usr/local/haproxy/sbin/haproxy"
PID="/var/run/haproxy.pid"
[ -f $config ] || exit 1
RETVAL=0
start() {
daemon $exec -c -q -f $config
if [ $? -ne 0 ]; then
echo "Errors found in configuration file."
return 1