summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-11-14 10:37:15 +1100
committerAmitay Isaacs <amitay@gmail.com>2012-11-14 10:57:48 +1100
commitf082f4006fb856445cec534eef03470fa5b1d5f5 (patch)
tree88dd5eedc3759bf097c59e0c26839e57c4811123
parent4c5852bf0fa17717a79264a0f604b920d8039fb7 (diff)
downloadsamba-f082f4006fb856445cec534eef03470fa5b1d5f5.tar.gz
samba-f082f4006fb856445cec534eef03470fa5b1d5f5.tar.xz
samba-f082f4006fb856445cec534eef03470fa5b1d5f5.zip
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 <martin@meltin.net> (This used to be ctdb commit f243a916ee71013f7402b9c396c2ead88eb3aab0)
-rwxr-xr-xctdb/config/events.d/10.interface11
1 files 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
-
;;