1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-26 18:50:30 +03:00

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)
This commit is contained in:
Martin Schwenke 2012-11-14 10:37:15 +11:00 committed by Amitay Isaacs
parent 4c5852bf0f
commit f082f4006f

View File

@ -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
;;