eventscripts: A missing interface should cause monitoring to fail
authorMartin Schwenke <martin@meltin.net>
Tue, 16 Jul 2013 09:31:05 +0000 (19:31 +1000)
committerMartin Schwenke <martin@meltin.net>
Tue, 16 Jul 2013 09:32:38 +0000 (19:32 +1000)
A missing interface is at least as bad as an interface with a link
that is down so should have a similar effect.

This couldn't be done previously because orphaned interfaces used to
be listed for monitoring.  This was worked around in 10.interface in
commit a5b8e2c1ec1b4fd7ef25e70a919ef4c70f3e1c75.

If $CTDB_PARTIALLY_ONLINE_INTERFACES="yes" then monitoring won't
actually fail but the interface is still marked as down.

This effectively reverts d40330453854d81d182112b49f5f6f2e0814b231 and
89547a1910fd74f98ae9d5737914328eb5cc3eaf.  However, it heeds the
warning in the commit message for latter by avoiding an early exit.
it just flags a failure and marks the interfaces as down in ctdbd.

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

index d40715401e1fe7f055ed314299b92b8b25428bfa..ce648a1957598d0c9139dc125f833dc53bb8e2d5 100755 (executable)
@@ -38,6 +38,9 @@ monitor_interfaces()
        for IFACE in $INTERFACES ; do
 
            ip addr show $IFACE 2>/dev/null >/dev/null || {
+               echo "ERROR: Interface $IFACE does not exist but is used by public addresses"
+               fail=1
+               ctdb setifacelink $IFACE down >/dev/null 2>/dev/null
                continue
            }