Using notify script to start or stop services

Chad <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>
First of all thank you for your work on keepalived I am a huge fan and have used it many times!!!

I have a service that requires the IP to be up/bound before the service starts (I consider this a bug myself, but it is 
what it is).
I am thinking of using the notify script to start the service when it is triggers with a MASTER and stop the service 
when it is triggered with a BACKUP.

My question is when does the notify script run?
Before, in parallel, or after the virtual IPs are up?

If it is before or in parallel, then I would request that the development team add a new option like: POST_SCRIPT
That is exactly like notify only is run after all IPs are up.

I know I can solve the issue inside the script like so:
1. fork script into background and return so keepalived continues
2. enter a tight loop and check if the virtual IP is up (this can be done in a few ways like ifconfig | grep <ip> or if 
you are looking for the device name, ifconfig | grep eth0:0. Of course there are other ways like looking in /proc.)
3. Once the IP is up execute whatever code you want, in my case /etc/init.d/service start|stop

-- 

^C
Chad
20 years of application development and sysadmin
Currently maintaining about 30 CentOS 6 servers.
Have maintained over 1,000 linux servers over the years.

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.