From: Martin Schwenke Date: Thu, 17 Oct 2013 05:17:26 +0000 (+1100) Subject: eventscripts: NAT gateway script doesn't need to handle "recovered" event X-Git-Tag: ctdb-2.5~42 X-Git-Url: http://git.samba.org/?p=ctdb.git;a=commitdiff_plain;h=542c70d6281d636ecd51502fbbf219f418bfac66 eventscripts: NAT gateway script doesn't need to handle "recovered" event Any time a node changes flags in any significant way there will be a takeover run, which will generate an "ipreallocated" event. The "recovered" event always happens straight after a takeover run so we update the NAT gateway twice. Signed-off-by: Martin Schwenke --- diff --git a/config/events.d/11.natgw b/config/events.d/11.natgw index 2c62eca3..85550050 100755 --- a/config/events.d/11.natgw +++ b/config/events.d/11.natgw @@ -50,14 +50,8 @@ ensure_natgwmaster () natgwip="$2" if [ "$natgwmaster" = "-1" ]; then - echo "There is no NATGW master node" - # The recovered event should never fail - we'll catch this - # failure in the monitor event. - if [ "$_event" = "recovered" ] ; then - exit 0 - else - exit 1 - fi + # Fail... + die "There is no NATGW master node" fi } @@ -75,7 +69,7 @@ case "$1" in echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce ;; - recovered|updatenatgw|ipreallocated) + updatenatgw|ipreallocated) mypnn=$(ctdb pnn | cut -d: -f2) set_natgw_capability