| # config.rc sample with defaults : |
| # config /etc/haproxy/haproxy.cfg |
| config="/etc/haproxy/haproxy.cfg" |
| . $ROOT/sbin/init.d/default |
| if [ -e "$config" ]; then |
| maintfd=`grep '^\([^#]*\)\(listen\|server\)' $config|wc -l` |
| maxfd=$[$maxconn*2 + $maintfd] |
| if [ $maxfd -lt 100 ]; then |
| cmdline="$cmdline -n $maxconn -f $config" |
| # to get a core when needed, uncomment the following : |
| pids=`pidof -o $$ -- $PNAME` |
| if [ ! -z "$pids" ]; then |
| echo "Asking $PNAME to terminate gracefully..." |
| echo "(use kill $pids to stop immediately)." |
| pids=`pidof -o $$ -- $PNAME` |
| if [ ! -z "$pids" ]; then |
| echo "Dumping $PNAME status in logs." |
| echo "Process $PNAME is not running." |