Hello,

We've been seeing another minor issue I've been meaning to ask about. We're 
using a server state file:

server-state-file /var/lib/haproxy/server_state

In my systemd config for haproxy I've added a couple lines to save the server 
state on reload/stop:

ExecReload=/usr/local/sbin/haproxy -Ws -f $CONFIG -c -q $EXTRAOPTS
ExecReload=/opt/bin/save_server_state.sh
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/opt/bin/save_server_state.sh

The script simply runs:

echo "show servers state" | socat /var/run/haproxy/admin.sock - > \
  /var/lib/haproxy/server_state

I've noticed that when I change the port on a backend server and reload, 
haproxy does not update the port for that server. I have to shut down haproxy, 
delete the state file, then start it back up for it to update the port 
(changing the port and renaming the server, reloading, then renaming it back 
and reloading again works too).

When I change other parts of the config, for example, if I add "disabled" to a 
server line and reload, haproxy updates the status of the server. It seems like 
haproxy isn't looking at the port when deciding if it should update the config 
for a server when using a state file.

Is this expected behavior?

Bren

Reply via email to