summaryrefslogtreecommitdiffstats
path: root/ctdb/config
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-12-10 22:27:36 +0100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2008-12-12 09:19:23 +1100
commit1cf23b1bd782a1ec29046f9597436e8280cbea44 (patch)
treebff407144f4e2d0cd65de84e6da2ede2afd5abdf /ctdb/config
parent54da843031256d64e775effb1190a2920c33f55f (diff)
downloadsamba-1cf23b1bd782a1ec29046f9597436e8280cbea44.tar.gz
samba-1cf23b1bd782a1ec29046f9597436e8280cbea44.tar.xz
samba-1cf23b1bd782a1ec29046f9597436e8280cbea44.zip
Improve the monitor event test for ethernet interfaces (link detection).
On some systems, the ethtool link detection is not successful when a cable is plugged but the interface has not been brought up previously. This improves the test by bringing the interface up (without checking for success here) and trying the ethtool test again afterwards. Michael (This used to be ctdb commit 0c2a7bf18c65452ca1c2f0539bf692507d91e3c6)
Diffstat (limited to 'ctdb/config')
-rwxr-xr-xctdb/config/events.d/10.interface11
1 files changed, 9 insertions, 2 deletions
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface
index 01302ba67e..298f3e85c8 100755
--- a/ctdb/config/events.d/10.interface
+++ b/ctdb/config/events.d/10.interface
@@ -158,8 +158,15 @@ case $cmd in
*)
[ -z "$IFACE" ] || {
/usr/sbin/ethtool $IFACE | grep -q 'Link detected: yes' || {
- echo "ERROR: No link on the public network interface $IFACE"
- exit 1
+ # On some systems, this is not successful when a
+ # cable is plugged but the interface has not been
+ # brought up previously. Bring the interface up and
+ # try again...
+ /sbin/ip link set $IFACE up
+ /usr/sbin/ethtool $IFACE | grep -q 'Link detected: yes' || {
+ echo "ERROR: No link on the public network interface $IFACE"
+ exit 1
+ }
}
}
;;