summaryrefslogtreecommitdiffstats
path: root/ctdb/config/events.d
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-12-09 11:33:04 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-12-09 11:33:04 +1100
commit50820f9e18c7e7a8a0f2350c5a87a3e445a6a148 (patch)
tree4d0d3a3b066b1515f1718c91e96928e5f88ed210 /ctdb/config/events.d
parent3ca3f4c771b648d742dba2e943ed943d80a45f77 (diff)
downloadsamba-50820f9e18c7e7a8a0f2350c5a87a3e445a6a148.tar.gz
samba-50820f9e18c7e7a8a0f2350c5a87a3e445a6a148.tar.xz
samba-50820f9e18c7e7a8a0f2350c5a87a3e445a6a148.zip
Bond devices can have any name the user configures, so
when checking link status for an interface, first check if this interface is in fact a bond device (by the precense of a /proc/net/bonding/IFACE file) and use that file for checking status. Othervise assume ib* is an infiniband interface which we donnt know how to check, or otherwise it is an ethernet interface and ethtool should hopefully work. (This used to be ctdb commit 8cc6c5de3d7abb0b72eaa6e769e70963b02d84cb)
Diffstat (limited to 'ctdb/config/events.d')
-rwxr-xr-xctdb/config/events.d/10.interface21
1 files changed, 13 insertions, 8 deletions
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface
index cf109f3ef8..f881808f11 100755
--- a/ctdb/config/events.d/10.interface
+++ b/ctdb/config/events.d/10.interface
@@ -142,18 +142,23 @@ case "$1" in
INTERFACES=`for IFACE in $INTERFACES ; do echo $IFACE ; done | sort | uniq`
for IFACE in $INTERFACES ; do
- case $IFACE in
- ethX*|bond*)
- IFACE=`echo $IFACE |sed -e 's/\....$//'`
- grep -q 'Currently Active Slave: None' /proc/net/bonding/$IFACE && {
- echo "ERROR: No active slaves for bond device $IFACE"
+ # These interfaces are sometimes bond devices
+ # When we use VLANs for bond interfaces, there will only
+ # be an entry in /proc for the underlying real interface
+ REALIFACE=`echo $IFACE |sed -e 's/\..*$//'`
+ [ -f /proc/net/bonding/$REALIFACE ] && {
+ grep -q 'Currently Active Slave: None' /proc/net/bonding/$REALIFACE && {
+ echo "ERROR: No active slaves for bond device $REALIFACE"
exit 1
}
- grep -q '^MII Status: up' /proc/net/bonding/$IFACE || {
- echo "ERROR: public network interface $IFACE is down"
+ grep -q '^MII Status: up' /proc/net/bonding/$REALIFACE || {
+ echo "ERROR: public network interface $REALIFACE is down"
exit 1
}
- ;;
+ exit 0;
+ }
+
+ case $IFACE in
ib*)
# we dont know how to test ib links
;;