Always store state on reload/restart/stop

Hi,

I have a situation where I need to have some servers in MAINT state for days.
In the meantime I often need to reload (or restart) HAProxy and keep those states.

I have configured a state file, that is read at startup, and I have modified the “ExecReload” commands in the systemd unit.

I wonder if I should do the same for ExecStop (to store the state before stopping).

Is there a situation where this would be a bad idea ?

Thanks

I think it’s a good idea. Think about a situation where you need to reboot the OS due to a kernel upgrade. You’d still want the to safe the MAINT state to the state file.

If your team or whoever needs to troubleshoot this is aware that both a reload, restart and stop/start actually safes the maintains the MAINT state of the backend servers, I don’t see any issue with it.