[ofa-general] [PATCH] opensm/scripts: removing trailing blanks

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Wed Jan 16 05:57:26 PST 2008


Hi Sasha.

Cosmetics - removing trailing blanks.

Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/scripts/opensm.conf        |    6 ++--
 opensm/scripts/opensmd            |   54 ++++++++++++++++++------------------
 opensm/scripts/redhat-opensm.init |   54 ++++++++++++++++++------------------
 opensm/scripts/sldd.sh            |   30 ++++++++++----------
 4 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/opensm/scripts/opensm.conf b/opensm/scripts/opensm.conf
index 3c5dcdf..2ec63d4 100644
--- a/opensm/scripts/opensm.conf
+++ b/opensm/scripts/opensm.conf
@@ -14,7 +14,7 @@
 #  none, no debug options are enabled.
 DEBUG=none

-# LMC
+# LMC
 #  This option specifies the subnet's LMC value.
 #  The number of LIDs assigned to each port is 2^LMC.
 #  The LMC value must be in the range 0-7.
@@ -60,7 +60,7 @@ TIMEOUT=200
 #  This option defines the log to be the given file.
 #  By default the log goes to /var/log/opensm.log
 #  For the log to go to standard output use OSM_LOG=stdout.
-OSM_LOG=/var/log/opensm.log
+OSM_LOG=/var/log/opensm.log
 # VERBOSE
 #  This option increases the log verbosity level.
 #  The "-v" option may be specified multiple times
@@ -103,7 +103,7 @@ OSM_CACHE_DIR=/var/cache/opensm
 #  Set to '--cache-options' or '-c' in order to enable
 CACHE_OPTIONS="none"

-# HONORE_GUID2LID
+# HONORE_GUID2LID
 #  This option forces OpenSM to honor the guid2lid file,
 #  when it comes out of Standby state, if such file exists
 #  under OSM_CACHE_DIR, and is valid.
diff --git a/opensm/scripts/opensmd b/opensm/scripts/opensmd
index 0a5fe9b..276a76f 100755
--- a/opensm/scripts/opensmd
+++ b/opensm/scripts/opensmd
@@ -62,7 +62,7 @@ shift
 if [ ! -x  $prog ]; then
     echo "OpenSM not installed"
     exit 1
-fi
+fi

 # Check if OpenSM configured to start automatically
 if [[ -z $ONBOOT || "$ONBOOT" != "yes" ]]; then
@@ -248,7 +248,7 @@ echo_failure() {
   [ "$BOOTUP" = "color" ] && $MOVE_TO_COL
   echo -n "["
   [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE
-  echo -n $"FAILED"
+  echo -n $"FAILED"
   [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
   echo -n "]"
   echo -e "\r"
@@ -257,7 +257,7 @@ echo_failure() {


 #########################################################################
-
+
 # Check if $pid (could be plural) are running
 checkpid() {
         local i
@@ -321,10 +321,10 @@ start()
         echo "Please load Infiniband driver first"
         echo
         return 2
-    fi
-
+    fi
+
     local OSM_PID=
-
+
     if [ -f $PID_FILE ]; then
             local line p
             read line < $PID_FILE
@@ -332,14 +332,14 @@ start()
                     [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p"
             done
     fi
-
+
     if [ -z "$pid" ]; then
         pid=`pidof -o $$ -o $PPID -o %PPID -x $bin`
     fi
-
+
     if [ -n "${pid:-}" ] ; then
         echo $"${bin} (pid $pid) is already running..."
-    else
+    else

 	if [ -n "${HONORE_GUID2LID_FLAG}" ]; then
 		# Run sldd daemod
@@ -352,17 +352,17 @@ start()
         do
             [ ! -z "$flag" ] && START_FLAGS="$START_FLAGS $flag"
         done
-
+
         echo $PORT_FLAG | $prog $START_FLAGS > /dev/null 2>&1 &
         OSM_PID=$!
         echo $OSM_PID > $PID_FILE
-	sleep 1
+	sleep 1
         checkpid $OSM_PID
         RC=$?
         [ $RC -eq 0 ] && echo_success "$bin start" || echo_failure "$bin start"
-
+
     fi
-return $RC
+return $RC
 }

 stop()
@@ -381,11 +381,11 @@ stop()
                     [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid1="$pid1 $p"
             done
     fi
-
+
     pid2=`pidof -o $$ -o $PPID -o %PPID -x $bin`
-
-    pid=`echo "$pid1 $pid2" | sed -e 's/\ /\n/g' | sort -n | uniq | sed -e 's/\n/\ /g'`
-
+
+    pid=`echo "$pid1 $pid2" | sed -e 's/\ /\n/g' | sort -n | uniq | sed -e 's/\n/\ /g'`
+
     if [ -n "${pid:-}" ] ; then
         # Kill opensm
         kill -15 $pid > /dev/null 2>&1
@@ -398,7 +398,7 @@ stop()
                 kill -KILL $p > /dev/null 2>&1
                 echo -n "."
                 sleep 1
-            done
+            done
         done
         echo
         checkpid $pid
@@ -408,24 +408,24 @@ stop()
     else
         echo_failure "$bin shutdown"
         RC=1
-    fi
-
+    fi
+
     # Remove pid file if any.
     rm -f $PID_FILE
-return $RC
+return $RC
 }

 status()
 {
     local pid
-
+
     # First try "pidof"
     pid=`pidof -o $$ -o $PPID -o %PPID -x ${bin}`
     if [ -n "$pid" ]; then
             echo $"${bin} (pid $pid) is running..."
-            return 0
+            return 0
     fi
-
+
      # Next try "/var/run/opensm.pid" files
      if [ -f $PID_FILE ] ; then
              read pid < $PID_FILE
@@ -435,7 +435,7 @@ status()
              fi
      fi
      echo $"${bin} is stopped"
-     return 3
+     return 3
 }


@@ -445,7 +445,7 @@ case $ACTION in
                 start
 		;;
 	stop)
-		stop
+		stop
 		;;
 	restart)
 		stop
@@ -455,7 +455,7 @@ case $ACTION in
 		status
 		;;
 	*)
-		echo
+		echo
 		echo "Usage: `basename $0` {start|stop|restart|status}"
 		echo
 		exit 1
diff --git a/opensm/scripts/redhat-opensm.init b/opensm/scripts/redhat-opensm.init
index 34739f3..9780f4f 100755
--- a/opensm/scripts/redhat-opensm.init
+++ b/opensm/scripts/redhat-opensm.init
@@ -155,7 +155,7 @@ fi


 #########################################################################
-
+
 start_sldd()
 {
     if [ -f $sldd_pid_file ]; then
@@ -205,9 +205,9 @@ stop_sldd()
 start()
 {
     local OSM_PID=
-
+
     pid=""
-
+
     if [ -f $PID_FILE ]; then
             local line p
             read line < $PID_FILE
@@ -215,14 +215,14 @@ start()
                     [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p"
             done
     fi
-
+
     if [ -z "$pid" ]; then
         pid=`pidof -o $$ -o $PPID -o %PPID -x $bin`
     fi
-
+
     if [ -n "${pid:-}" ] ; then
         echo $"${bin} (pid $pid) is already running..."
-    else
+    else

 	if [ -n "${HONORE_GUID2LID_FLAG}" ]; then
 		# Run sldd daemod
@@ -235,20 +235,20 @@ start()
         do
             [ ! -z "$flag" ] && START_FLAGS="$START_FLAGS $flag"
         done
-
-	echo -n "Starting IB Subnet Manager"
+
+	echo -n "Starting IB Subnet Manager"
         echo $PORT_FLAG | $prog $START_FLAGS > /dev/null 2>&1 &
         OSM_PID=$!
         echo $OSM_PID > $PID_FILE
-	sleep 1
+	sleep 1
         checkpid $OSM_PID
         RC=$?
         [ $RC -eq 0 ] && echo_success || echo_failure
         [ $RC -eq 0 ] && touch /var/lock/subsys/opensm
 	echo
-
+
     fi
-return $RC
+return $RC
 }

 stop()
@@ -267,11 +267,11 @@ stop()
                     [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid1="$pid1 $p"
             done
     fi
-
+
     pid2=`pidof -o $$ -o $PPID -o %PPID -x $bin`
-
-    pid=`echo "$pid1 $pid2" | sed -e 's/\ /\n/g' | sort -n | uniq | sed -e 's/\n/\ /g'`
-
+
+    pid=`echo "$pid1 $pid2" | sed -e 's/\ /\n/g' | sort -n | uniq | sed -e 's/\n/\ /g'`
+
     if [ -n "${pid:-}" ] ; then
         # Kill opensm
 	echo -n "Stopping IB Subnet Manager."
@@ -280,7 +280,7 @@ stop()
         while [ $cnt -lt 6 -a $alive -ne 0 ]; do
 		echo -n ".";
 		alive=0
-		for p in $pid; do
+		for p in $pid; do
 			if checkpid $p ; then alive=1; echo -n "-"; fi
 		done
 		let cnt++;
@@ -293,11 +293,11 @@ stop()
                 kill -KILL $p > /dev/null 2>&1
                 echo -n "+"
                 sleep 1
-            done
+            done
         done
         checkpid $pid
         RC=$?
-        [ $RC -eq 0 ] && echo_failure || echo_success
+        [ $RC -eq 0 ] && echo_failure || echo_success
 	echo
         RC=$((! $RC))
     else
@@ -305,25 +305,25 @@ stop()
         echo_failure
 	echo
         RC=1
-    fi
-
+    fi
+
     # Remove pid file if any.
     rm -f $PID_FILE
     rm -f /var/lock/subsys/opensm
-    return $RC
+    return $RC
 }

 status()
 {
     local pid
-
+
     # First try "pidof"
     pid=`pidof -o $$ -o $PPID -o %PPID -x ${bin}`
     if [ -n "$pid" ]; then
             echo $"${bin} (pid $pid) is running..."
-            return 0
+            return 0
     fi
-
+
      # Next try "/var/run/opensm.pid" files
      if [ -f $PID_FILE ] ; then
              read pid < $PID_FILE
@@ -333,7 +333,7 @@ status()
              fi
      fi
      echo $"${bin} is stopped"
-     return 3
+     return 3
 }


@@ -343,7 +343,7 @@ case $ACTION in
                 start
 		;;
 	stop)
-		stop
+		stop
 		;;
 	restart)
 		stop
@@ -361,7 +361,7 @@ case $ACTION in
 		fi
 		;;
 	*)
-		echo
+		echo
 		echo "Usage: `basename $0` {start|stop|restart|status}"
 		echo
 		exit 1
diff --git a/opensm/scripts/sldd.sh b/opensm/scripts/sldd.sh
index 496e74d..cf844a9 100755
--- a/opensm/scripts/sldd.sh
+++ b/opensm/scripts/sldd.sh
@@ -27,16 +27,16 @@
 #
 #

-# OpenSM found to have the following problem
-# when handover is performed:
+# OpenSM found to have the following problem
+# when handover is performed:
 # If some of the cluster nodes are rebooted during the handover they loose their LID assignment.
-# The reason for it is that the standby SM does not obey its own Guid to LID table
-# and simply uses the discovered LIDs. If some nodes are not available for it
+# The reason for it is that the standby SM does not obey its own Guid to LID table
+# and simply uses the discovered LIDs. If some nodes are not available for it
 # their previous LID assignment is lost forever.

 # The idea is to use an external daemon that will distribute
 # the semi-static LID assignment table from the master SM to all standby SMs.
-# A standby SM, becoming a master . needs to obey the copied semi static LID assignment table.
+# A standby SM, becoming a master . needs to obey the copied semi static LID assignment table.

 # config: /etc/opensm.conf

@@ -66,7 +66,7 @@ declare -i SLDD_DEBUG
 RESCAN_TIME=${RESCAN_TIME:-60}

 if [ -z "${OSM_HOSTS}" ]; then
-	[ $SLDD_DEBUG -eq 1 ] &&
+	[ $SLDD_DEBUG -eq 1 ] &&
 	echo "No OpenSM servers (OSM_HOSTS) configured for the IB subnet."
 	exit 0
 fi
@@ -78,7 +78,7 @@ arr_OSM_HOSTS=(${OSM_HOSTS})
 num_of_osm_hosts=${#arr_OSM_HOSTS[@]}

 if [ ${num_of_osm_hosts} -eq 1 ]; then
-	[ $SLDD_DEBUG -eq 1 ] &&
+	[ $SLDD_DEBUG -eq 1 ] &&
 	echo "One OpenSM server configured in the IB subnet." &&
 	echo "Nothing to be done for SLDD"

@@ -123,19 +123,19 @@ update_remote_cache()
 		if is_alive $host; then
 			stat=$($RSH $host "/bin/mkdir -p ${CACHE_DIR} > /dev/null 2>&1; /bin/rm -f ${CACHE_FILE}.${local_host} > /dev/null 2>&1; echo \$?" | tr -d '[:space:]')
 			if [ "X${stat}" == "X0" ]; then
-				[ $SLDD_DEBUG -eq 1 ] &&
+				[ $SLDD_DEBUG -eq 1 ] &&
 				echo "Updating $host"
 				logger -i "SLDD: updating $host with ${CACHE_FILE}"
 				$RCP ${CACHE_FILE}.upd ${host}:${CACHE_FILE}.${local_host}
 				/bin/cp ${CACHE_FILE}.upd ${CACHE_FILE}.${host}
 			else
-				[ $SLDD_DEBUG -eq 1 ] &&
+				[ $SLDD_DEBUG -eq 1 ] &&
 				echo "$RSH to $host failed."
 				logger -i "SLDD: Failed to update $host with ${CACHE_FILE}. $RSH without password should be enabled"
 				exit 5
 			fi
 		else
-			[ $SLDD_DEBUG -eq 1 ] &&
+			[ $SLDD_DEBUG -eq 1 ] &&
 			echo "$host is down."
 			continue
 		fi
@@ -203,7 +203,7 @@ do

 			# Check if local cache file larger than remote chache file
 			if [ ${new_size} -gt ${largest_remote_cache_size} ]; then
-				[ $SLDD_DEBUG -eq 1 ] &&
+				[ $SLDD_DEBUG -eq 1 ] &&
 				echo "Local cache file larger then remote. Update remote cache files"
 				last_size=${new_size}
 				update_remote_cache
@@ -220,7 +220,7 @@ do

 		# Update local cache file from remote
 		if [ ${largest_remote_cache_size} -gt ${new_size} ]; then
-			[ $SLDD_DEBUG -eq 1 ] &&
+			[ $SLDD_DEBUG -eq 1 ] &&
 			echo "Local cache file shorter then remote. Use ${largest_remote_cache}"
 			logger -i "SLDD: updating local cache file with ${largest_remote_cache}"
 			swap_cache_files
@@ -228,13 +228,13 @@ do
 		fi

 	else # The local cache file is empty
-		[ $SLDD_DEBUG -eq 1 ] &&
+		[ $SLDD_DEBUG -eq 1 ] &&
 		echo "${CACHE_FILE} is empty"

 		largest_remote_cache=$(get_largest_remote_cache)
 		if [[ -n "${largest_remote_cache}" && -s "${largest_remote_cache}" ]]; then
 			# Copy it to the current cache
-			[ $SLDD_DEBUG -eq 1 ] &&
+			[ $SLDD_DEBUG -eq 1 ] &&
 			echo "Local cache file is empty. Use ${largest_remote_cache}"
 			logger -i "SLDD: updating local cache file with ${largest_remote_cache}"
 			swap_cache_files
@@ -242,7 +242,7 @@ do

 	fi

-	[ $SLDD_DEBUG -eq 1 ] &&
+	[ $SLDD_DEBUG -eq 1 ] &&
 	echo "Sleeping ${RESCAN_TIME} seconds."
 	sleep ${RESCAN_TIME}

-- 
1.5.1.4




More information about the general mailing list