mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
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)
This commit is contained in:
parent
54da843031
commit
1cf23b1bd7
@ -158,8 +158,15 @@ case $cmd in
|
|||||||
*)
|
*)
|
||||||
[ -z "$IFACE" ] || {
|
[ -z "$IFACE" ] || {
|
||||||
/usr/sbin/ethtool $IFACE | grep -q 'Link detected: yes' || {
|
/usr/sbin/ethtool $IFACE | grep -q 'Link detected: yes' || {
|
||||||
echo "ERROR: No link on the public network interface $IFACE"
|
# On some systems, this is not successful when a
|
||||||
exit 1
|
# 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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user