When daemon mode was specified this script was reporting "failure" on start
when it actually worked.  This fixes it by just waiting for a valid pid of
opensm.

Ira


>From 8f9b550c055b0fabf4c5fd6652060fae5dd7216b Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <[EMAIL PROTECTED]>
Date: Thu, 24 Jan 2008 10:51:23 -0800
Subject: [PATCH] opensm/scripts/redhat-opensm.init: fix starting opensm when 
using daemon mode


Signed-off-by: Ira K. Weiny <[EMAIL PROTECTED]>
---
 opensm/scripts/redhat-opensm.init |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/opensm/scripts/redhat-opensm.init 
b/opensm/scripts/redhat-opensm.init
index 56dbb7c..3e00403 100755
--- a/opensm/scripts/redhat-opensm.init
+++ b/opensm/scripts/redhat-opensm.init
@@ -238,9 +238,19 @@ start()
 
        echo -n "Starting IB Subnet Manager"
         echo $PORT_FLAG | $prog $START_FLAGS > /dev/null 2>&1 &
-        OSM_PID=$!
+        cnt=0; alive=0
+        while [ $cnt -lt 6 -a $alive -ne 1 ]; do
+               echo -n ".";
+               sleep 1
+               alive=0
+                OSM_PID=`pidof $prog`
+                if [ "$OSM_PID" != "" ]; then
+                        alive=1
+                fi
+               let cnt++;
+       done
+
         echo $OSM_PID > $PID_FILE
-       sleep 1
         checkpid $OSM_PID
         RC=$?
         [ $RC -eq 0 ] && echo_success || echo_failure
-- 
1.5.1

Attachment: 0001-opensm-scripts-redhat-opensm.init-fix-starting-open.patch
Description: Binary data

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to