[ofa-general] [PATCH] opensm/scripts: remove opensm.conf usage

Sasha Khapyorsky sashak at voltaire.com
Fri May 23 01:50:10 PDT 2008


Remove opensm.conf usage - startup script configuration will be
replaced soon by OpenSM's opensm.conf.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/scripts/opensm.sysconfig      |    4 +-
 opensm/scripts/redhat-opensm.init.in |  103 ++--------------------------------
 opensm/scripts/sldd.sh.in            |    3 +-
 3 files changed, 8 insertions(+), 102 deletions(-)

diff --git a/opensm/scripts/opensm.sysconfig b/opensm/scripts/opensm.sysconfig
index d3fba93..2cc02e6 100644
--- a/opensm/scripts/opensm.sysconfig
+++ b/opensm/scripts/opensm.sysconfig
@@ -1,2 +1,2 @@
-# If you want to pass any options to OpenSM, set them here.
-OPTIONS=
+# It will be used for sldd.sh
+OSM_HOSTS=""
diff --git a/opensm/scripts/redhat-opensm.init.in b/opensm/scripts/redhat-opensm.init.in
index 5cc9079..5526e44 100755
--- a/opensm/scripts/redhat-opensm.init.in
+++ b/opensm/scripts/redhat-opensm.init.in
@@ -38,7 +38,7 @@
 #  $Id: openib-1.0-opensm.init,v 1.5 2006/08/02 18:18:23 dledford Exp $
 #
 # processname: @sbindir@/opensm
-# config: @OPENSM_CONFIG_DIR@/opensm.conf
+# config: @sysconfdir@/sysconfig/opensm.conf
 # pidfile: /var/run/opensm.pid
 
 prefix=@prefix@
@@ -46,7 +46,7 @@ exec_prefix=@exec_prefix@
 
 . /etc/rc.d/init.d/functions
 
-CONFIG=@OPENSM_CONFIG_DIR@/opensm.conf
+CONFIG=@sysconfdir@/sysconfig/opensm.conf
 if [ ! -f $CONFIG ]; then
     exit 0
 fi
@@ -67,97 +67,10 @@ ACTION=$1
 PID_FILE=/var/run/${bin}.pid
 touch $PID_FILE
 
-if [[ -z $DEBUG || "$DEBUG" == "none" ]]; then
-    DEBUG_FLAG=""
-else
-    DEBUG_FLAG="-d ${DEBUG}"
-fi
-
-if [[ -z $LMC || "$LMC" == "0" ]]; then
-    LMC_FLAG=""
-else
-    LMC_FLAG="-l ${LMC}"
-fi
-
-if [[ -z $MAXSMPS || "$MAXSMPS" == "4" ]]; then
-    MAXSMPS_FLAG=""
-else
-    MAXSMPS_FLAG="-maxsmps ${MAXSMPS}"
-fi
-
-if [[ -z $REASSIGN_LIDS || "$REASSIGN_LIDS" == "no" ]]; then
-    REASSIGN_LIDS_FLAG=""
-else
-    REASSIGN_LIDS_FLAG="-r"
-fi
-
-if [[ -z $SWEEP || "$SWEEP" == "10" ]]; then
-    SWEEP_FLAG=""
-else
-    SWEEP_FLAG="-s ${SWEEP}"
-fi
-
-if [[ -z $TIMEOUT || "$TIMEOUT" == "100" ]]; then
-    TIMEOUT_FLAG=""
-else
-    TIMEOUT_FLAG="-t ${TIMEOUT}"
-fi
-
-if [[ -z $OSM_LOG || "$OSM_LOG" == "/tmp/osm.log" ]]; then
-    OSM_LOG_FLAG=""
-else
-    OSM_LOG_FLAG="-f ${OSM_LOG}"
-fi
-
-if [[ -z $VERBOSE || "$VERBOSE" == "none" ]]; then
-    VERBOSE_FLAG=""
-else
-    VERBOSE_FLAG="${VERBOSE}"
-fi
-
-if [[ -z $UPDN || "$UPDN" == "off" ]]; then
-    UPDN_FLAG=""
-else
-    UPDN_FLAG="-u"
-fi
-
-if [[ -z $GUID_FILE || "$GUID_FILE" == "none" ]]; then
-    GUID_FILE_FLAG=""
-else
-    GUID_FILE_FLAG="-a ${GUID_FILE}"
-fi
-
-if [[ -z $GUID || "$GUID" == "none" ]]; then
-    GUID_FLAG=""
-else
-    GUID_FLAG="-g ${GUID}"
-fi
-
-if [[ -z $HONORE_GUID2LID || "$HONORE_GUID2LID" == "none" ]]; then
-    HONORE_GUID2LID_FLAG=""
-else
-    HONORE_GUID2LID_FLAG="--honor_guid2lid"
-fi
-
 if [[ -n "${OSM_HOSTS}" && $(echo -n ${OSM_HOSTS} | wc -w | tr -d '[:space:]') -gt 1  ]]; then
-    HONORE_GUID2LID_FLAG="--honor_guid2lid"
+    HONORE_GUID2LID="--honor_guid2lid"
 fi
 
-
-if [[ -z $CACHE_OPTIONS || "$CACHE_OPTIONS" == "none" ]]; then
-    CACHE_OPTIONS_FLAG=""
-else
-    CACHE_OPTIONS_FLAG="--cache-options"
-fi
-
-
-if [ -z $PORT_NUM ]; then
-    PORT_FLAG=1
-else
-    PORT_FLAG="${PORT_NUM}"
-fi
-
-
 #########################################################################
 
 start_sldd()
@@ -228,20 +141,14 @@ start()
         echo $"${bin} (pid $pid) is already running..."
     else
 
-	if [ -n "${HONORE_GUID2LID_FLAG}" ]; then
+	if [ -n "${HONORE_GUID2LID}" ]; then
 		# Run sldd daemod
 		start_sldd
 	fi
 
         # Start opensm
-        local START_FLAGS=""
-        for flag in "$DEBUG_FLAG" "$LMC_FLAG" "$MAXSMPS_FLAG" "$REASSIGN_LIDS_FLAG" "$SWEEP_FLAG" "$TIMEOUT_FLAG" "$OSM_LOG_FLAG" "$VERBOSE_FLAG" "$UPDN_FLAG" "$GUID_FILE_FLAG" "$GUID_FLAG" "$HONORE_GUID2LID_FLAG" "$CACHE_OPTIONS_FLAG"
-        do
-            [ ! -z "$flag" ] && START_FLAGS="$START_FLAGS $flag"
-        done
-
 	echo -n "Starting IB Subnet Manager"
-        echo $PORT_FLAG | $prog $START_FLAGS > /dev/null 2>&1 &
+        $prog --daemon ${HONORE_GUID2LID} > /dev/null
         cnt=0; alive=0
         while [ $cnt -lt 6 -a $alive -ne 1 ]; do
 		echo -n ".";
diff --git a/opensm/scripts/sldd.sh.in b/opensm/scripts/sldd.sh.in
index a6f660f..8162c5c 100755
--- a/opensm/scripts/sldd.sh.in
+++ b/opensm/scripts/sldd.sh.in
@@ -41,10 +41,9 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 
-# config: @sysconfdir@/ofa/opensm.conf
+# config: @sysconfdir@/sysconfig/opensm.conf
 
 [ -f @sysconfdir@/sysconfig/opensm.conf ] && CONFIG=@sysconfdir@/sysconfig/opensm.conf
-[ -f @sysconfdir@/ofa/opensm.conf ] && CONFIG=@sysconfdir@/ofa/opensm.conf
 
 SLDD_DEBUG=${SLDD_DEBUG:-0}
 
-- 
1.5.5.1.178.g1f811




More information about the general mailing list