Eventscripts - 10.interfaces should not check orphaned interfaces.
authorMartin Schwenke <martin@meltin.net>
Mon, 1 Aug 2011 03:37:06 +0000 (13:37 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 2 Aug 2011 05:53:24 +0000 (15:53 +1000)
commita5b8e2c1ec1b4fd7ef25e70a919ef4c70f3e1c75
tree3ed678925650941c357b2efa2180cf53625f3f39
parent7467a04eb9fa5c25fea3870d7795c9c00222a6d9
Eventscripts - 10.interfaces should not check orphaned interfaces.

If the last IP address on an interfaces is removed then that
interfaces should no longer be checked by 10.interfaces.  However,
"ctdb ifaces" still lists such interfaces so they are currently
checked.

The problem really needs to be addressed in ctdbd but a neat quick
eventscript fix will be minimally invasive...

This changes the code to use "ctdb -Y ip -v" instead of "ctdb -Y
ifaces".  The former includes details of all public addresses and
associated interfaces, so when an address is removed there is no
output for it.  This avoids orphaned interfaces from being listed.

The logic is also slightly improved so that $IFACES includes just a
(non-uniquified) list of interfaces, allowing an existing loop to be
removed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/events.d/10.interface