Re: reloading haproxy

From: Jeremy <s6a9d6u9s#gmail.com>
Date: Wed, 20 May 2009 17:03:08 -0500


While we're on the subject, in case anyone else wants to use it (or knows a better way of doing this)... I stuck this in my haproxy init.d scrip (using CentOS/RedHat). I'm not sure how to make it do the fancy green [ OK ] output like start/stop does but that's ok.

reload() {
/usr/local/sbin/$BASENAME -c -q -f /etc/$BASENAME/$BASENAME.cfg
  if [ $? -ne 0 ]; then
    echo "Errors found in configuration file, check it with '$BASENAME check'."

    return 1
  fi
/usr/local/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg -sf $(pidof
haproxy)
  sleep 1
  pidof haproxy > /var/run/$BASENAME.pid }

....

# See how we were called.
case "$1" in
...
  reload)
    reload
... Received on 2009/05/21 00:03

This archive was generated by hypermail 2.2.0 : 2009/05/21 00:15 CEST