[ewg] [PATCH] ofed_1_2/ofed_scripts

Moni Shoua monisonlists at gmail.com
Thu May 3 08:36:52 PDT 2007


Fix some issues related to ib-bonding operation
1. Don't run ib-bond if ib-bonding is not installd
2. Display success/failure information when creating bonding interfaces
Signed-off-by: Moni Shoua <monis at voltaire.com>
---
 openibd |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ofed_scripts/openibd b/ofed_scripts/openibd
index 2da4b15..8fbaa69 100755
--- a/ofed_scripts/openibd
+++ b/ofed_scripts/openibd
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash 
 
 #
 # Copyright (c) 2006 Mellanox Technologies. All rights reserved.
@@ -798,7 +798,8 @@ start()
             ipoib_ha_pid=$!
             echo ${ipoib_ha_pid} > ${ipoib_ha_pidfile}
 	elif [ "X${IPOIBBOND_ENABLE}" == "Xyes" ]; then
-		if [ ! -z $IPOIB_BONDS ]; then
+		if ( test ! -z $IPOIB_BONDS && which ib-bond &>/dev/null ) ; then
+			echo Setting up bonding interfaces:
 			for bond in $(echo $IPOIB_BONDS|tr , " ") ;  do
 				eval bond_ip=\$${bond}_IP
 				if [ -z $bond_ip ]; then
@@ -810,7 +811,13 @@ start()
 					echo No slaves defined for $bond
 					continue
 				fi
-				ib-bond --bond-name $bond --bond-ip $bond_ip --slaves $bond_slaves
+				ib-bond --bond-name $bond --bond-ip $bond_ip --slaves $bond_slaves 
+				RC=$?
+				if [ $RC -eq 0 ] ; then
+					echo_success $"Bringing up interface $bond"
+				else
+					echo_failure $"Bringing up interface $bond"
+				fi
 			done
 		fi
         fi
@@ -1064,7 +1071,9 @@ stop()
         fi
 
         # Down all bond interfaces
-	ib-bond --stop-all
+	if ( which ib-bond &>/dev/null ) ; then
+		ib-bond --stop-all
+	fi
 
         # Stop SRP HA daemon if running
         if [ -f $srp_daemon_pidfile ]; then




More information about the ewg mailing list