Package: keepalived Version: 1.1.11-3 Severity: important Tags: patch When keepalived starts up, it tries to enter master mode, but if it detects the link is down on the interface it goes directly to the fault state, without calling the notify script about the change to fault state.
Similarly when keepalived is currently in backup state and it looses link, it goes directly to fault state without running the notify script. The included patch fixes it for me. It handles calling the notify script in the two places the state can be switched to fault which did not already call the notify script on the change. -- System Information: Debian Release: 3.1 APT prefers experimental APT policy: (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.12-1-k7 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Versions of packages keepalived depends on: ii iproute 20041019-3 Professional tools to control the ii ipvsadm 1.24+1.21-1 Linux Virtual Server support progr ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an ii libpopt0 1.7-5 lib for parsing cmdline parameters ii libssl0.9.7 0.9.7e-3 SSL shared libraries -- no debconf information
diff -ruN keepalived-1.1.11/keepalived/vrrp/vrrp.c keepalived-1.1.11.rr1/keepalived/vrrp/vrrp.c --- keepalived-1.1.11/keepalived/vrrp/vrrp.c 2005-02-28 19:27:11.000000000 -0500 +++ keepalived-1.1.11.rr1/keepalived/vrrp/vrrp.c 2005-11-01 11:11:21.000000000 -0500 @@ -786,6 +786,7 @@ vrrp->ms_down_timer = 3 * vrrp->adver_int + VRRP_TIMER_SKEW(vrrp); vrrp->state = VRRP_STATE_FAULT; + notify_instance_exec(vrrp, VRRP_STATE_FAULT); return 1; } diff -ruN keepalived-1.1.11/keepalived/vrrp/vrrp_scheduler.c keepalived-1.1.11.rr1/keepalived/vrrp/vrrp_scheduler.c --- keepalived-1.1.11/keepalived/vrrp/vrrp_scheduler.c 2005-02-28 19:27:44.000000000 -0500 +++ keepalived-1.1.11.rr1/keepalived/vrrp/vrrp_scheduler.c 2005-10-31 17:12:11.000000000 -0500 @@ -568,6 +568,9 @@ vrrp_log_int_down(vrrp); syslog(LOG_INFO, "VRRP_Instance(%s) Now in FAULT state", vrrp->iname); + if(vrrp->state != VRRP_STATE_FAULT) { + notify_instance_exec(vrrp, VRRP_STATE_FAULT); + } vrrp->state = VRRP_STATE_FAULT; vrrp->ms_down_timer = 3 * vrrp->adver_int + VRRP_TIMER_SKEW(vrrp);