Files
haproxy/init.d/haproxy
willy tarreau 535ae7aee2 * released 1.1.5
* connection logging displayed incorrect source address.
* added proxy start/stop and server up/down log events.
* replaced log message short buffers with larger trash.
* enlarged buffer to 8 kB and replace buffer to 4 kB.
* added a config.rc example for Formilux
* added a build script for Formilux
2005-12-17 12:58:00 +01:00

44 lines
764 B
Bash

#!/bin/sh
#
# config.rc sample with defaults :
# service haproxy
# config /etc/haproxy/haproxy.cfg
# maxconn 1024
#
config="/etc/haproxy/haproxy.cfg"
maxconn=1024
bin=/usr/sbin/haproxy
cmdline='$bin -D'
. $ROOT/sbin/init.d/default
if [ -e "$config" ]; then
maintfd=`grep '^\([^#]*\)\(listen\|server\)' $config|wc -l`
else
maintfd=0
fi
maxfd=$[$maxconn*2 + $maintfd]
if [ $maxfd -lt 100 ]; then
maxfd=100;
fi
cmdline="$cmdline -n $maxconn -f $config"
ulimit -n $maxfd
# to get a core when needed, uncomment the following :
# cd /var/tmp
# ulimit -c unlimited
# soft stop
function dostop {
pids=`pidof -o $$ -- $PNAME`
if [ ! -z "$pids" ]; then
echo "Asking $PNAME to terminate gracefully..."
kill -USR1 $pids
fi
}
main $*