I have set up master - slave using HAProxy. It is working as expected. When the master is not available it is automatically pointing to slave. I need to run a linux command at the time of the switch.
I will like to know how do I run the scripts / commands while changing to the slave.