mirror of
https://github.com/samba-team/samba.git
synced 2025-03-22 02:50:28 +03:00
eventscripts: A missing interface should cause monitoring to fail
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 49b2d1bd9554461ed8edbfc21e777c0eca9e1443 and fixed in ctdbd in commit cc1a3ae911d3fee8b87fda5de5ab6d9499d7510a. If $CTDB_PARTIALLY_ONLINE_INTERFACES="yes" then monitoring won't actually fail but the interface is still marked as down. While we're touching this code, use "ip link" instead of "ip addr". It is marginally cheaper but not enough for a separate patch. ;-) This effectively reverts d67955b42f7627be9dae995230c8fcbb8a948ec2. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 501f19b16fd6d67fbb754248868c38ee5bcf79ef)
This commit is contained in:
parent
4b5c9c7991
commit
1da757d91a
@ -65,8 +65,9 @@ monitor_interfaces()
|
||||
# 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 || {
|
||||
echo "WARNING: Interface $iface does not exist but it is used by public addresses."
|
||||
ip link show $iface 2>/dev/null >/dev/null || {
|
||||
echo "ERROR: Interface $iface does not exist but it is used by public addresses."
|
||||
mark_down $iface
|
||||
continue
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user