eventscripts: NAT gateway script doesn't need to handle "recovered" event
authorMartin Schwenke <martin@meltin.net>
Thu, 17 Oct 2013 05:17:26 +0000 (16:17 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 22 Oct 2013 03:34:05 +0000 (14:34 +1100)
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 <martin@meltin.net>
(This used to be ctdb commit 542c70d6281d636ecd51502fbbf219f418bfac66)

ctdb/config/events.d/11.natgw

index 2c62eca39a603655972ade29d68603b739f64022..855500500bbb429cfb5b7496f212297a63f4454c 100755 (executable)
@@ -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