From f082f4006fb856445cec534eef03470fa5b1d5f5 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 14 Nov 2012 10:37:15 +1100 Subject: Eventscripts: 10.interface startup event should only process interfaces once Provided that monitor_interfaces() sets the state of each interface, there's no need to mark all interfaces as up before running monitor_interfaces() in the startup event. monitor_interfaces() will set the true status of each interface anyway. The duplication is unnecessary and may cause extra action in the recovery daemon because the state of some interfaces is changed an extra time. Instead, add a comment at the top of the loop in monitor_interfaces() to warn against early loop exits. Signed-off-by: Martin Schwenke (This used to be ctdb commit f243a916ee71013f7402b9c396c2ead88eb3aab0) --- ctdb/config/events.d/10.interface | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface index dd54f1e395..80b136856b 100755 --- a/ctdb/config/events.d/10.interface +++ b/ctdb/config/events.d/10.interface @@ -56,6 +56,10 @@ monitor_interfaces() fail=false up_interfaces_found=false + # Note that this loop must not exit early. It must process + # all interfaces so that the correct state for each interface + # is set in CTDB using mark_up/mark_down. If there is a + # problem with an interface then set fail=true and continue. for iface in $all_interfaces ; do ip addr show $iface 2>/dev/null >/dev/null || { @@ -149,14 +153,7 @@ case "$1" in # called after ctdbd has done its initial recovery # and we start the services to become healthy startup) - # Assume all links are good initially - get_all_interfaces - for iface in $all_interfaces ; do - ctdb setifacelink $iface up >/dev/null 2>/dev/null - done - monitor_interfaces - ;; -- cgit