Debian – keepalived shutdown – does not run “notify” hook on daemon shutdown

debiankeepalived

I'm running keepalived under Debian (Lenny, Squeeze) in a fairly
simple setup, I'm just (ab)using it as a VRRP daemon to decide the
mastership
between two equal machines for some virtual IPs.
All the magic happens in the notify-script.

When I completely stop the daemon (using debian's init-script)
keepalived does
not run the notify-script for backup or at least fault mode, which is
what I would suspect and need.

I could "fix" the rc-script with some unwanted effects – the
notify-script would be hard-coded into the rc-script introducing an
unwanted coupling of these two and the mess of porting the patch to the
next debian versions so this is not the way I really want to go…

Any hints for a cleaner solution to this problem?

vrrp_instance FOORRP {
  virtual_router_id 42
  interface eth0
  state BACKUP
  priority 200
  nopreempt
  authentication {
    auth_type AH
    auth_pass foobar42
  }
  notify "/usr/local/bin/vrrp-state"
  virtual_ipaddress {
    127.0.0.2
  }
}

PS: the use of the "three notify_"-scripts does not change anything

PPS: in the changelog (Release 1.1.16) there is something
mentioned, that somehow fits my problem (though I am not using anything
lvs-related in keepalived), but I am using a newer version (1.1.20):
"notify_down isn't executed for working real servers on keepalived
shutdown."

Best Answer

Dug through more documentation and finally found it:

notify_stop "/usr/local/bin/vrrp-state fault"

Works as expected.... X-}