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
...

Reply via email to