Update init script to fix bug 453977

This commit is contained in:
Doug Ledford 2008-09-17 03:06:39 +00:00
parent 8cc0bf080e
commit a5e3309eed

View File

@ -19,6 +19,7 @@
prog=/usr/sbin/opensm
CONFIG=/etc/rdma/opensm.conf
PID_FILE=/var/run/opensm.pid
ACTION=$1
start()
{
@ -32,9 +33,9 @@ start()
[ -f /var/lock/subsys/opensm ] && return 0
# Start opensm
echo -n "Starting IB Subnet Manager:"
$prog $OPTIONS > /dev/null 2>&1 &
OSM_PID=$!
$prog $OPTIONS > /dev/null 2>&1
sleep 1
OSM_PID=`pidof $prog`
checkpid $OSM_PID
RC=$?
[ $RC -eq 0 ] && echo_success || echo_failure
@ -63,18 +64,23 @@ stop()
# Kill opensm
kill -15 $OSM_PID > /dev/null 2>&1
cnt=0
while [ $cnt -lt 6 -a checkpid $OSM_PID -eq 0 ]; do
while [ $cnt -lt 6 ]; do
checkpid $OSM_PID
if [ $? -ne 0 ]; then
break
fi
echo -n "."
sleep 1
let cnt++
cnt=$(( $cnt + 1 ))
done
if [ checkpid $OSM_PID -eq 0 ]; then
checkpid $OSM_PID
if [ $? -eq 0 ]; then
kill -KILL $OSM_PID > /dev/null 2>&1
echo -n "+"
sleep 1
fi
checkpid $pid
checkpid $OSM_PID
DEAD=$?
if [ $DEAD -eq 0 ]; then
echo_failure