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 06:53:14 +0000 (16:53 +1000)
commit652bf326e11eb7f46209f1c69546f7ceb4d7ac76
tree5eed73c5e02e65fb23eda802f213d91cf74fa76f
parenta17ae8a8bed982b9ecd064ccca0be88a61d2ec85
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>
(This used to be ctdb commit 49b2d1bd9554461ed8edbfc21e777c0eca9e1443)
ctdb/config/events.d/10.interface