[ofa-general] [PATCH] opensm/scripts: handling opensm config file
Yevgeny Kliteynik
kliteyn at dev.mellanox.co.il
Wed Oct 22 07:57:52 PDT 2008
Hi Sasha,
Following my previous questions, how about the following patch:
Use similar opensm config file name for redhat and suse distros,
and pass this config file to opensm wit the "--config" option.
Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
opensm/scripts/opensm.init.in | 6 +++---
opensm/scripts/redhat-opensm.init.in | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/opensm/scripts/opensm.init.in b/opensm/scripts/opensm.init.in
index c31f017..af0fd19 100644
--- a/opensm/scripts/opensm.init.in
+++ b/opensm/scripts/opensm.init.in
@@ -53,13 +53,13 @@ if [[ -s /etc/rc.status ]]; then
failure() { rc_status -v; }
success() { rc_status -v; }
fi
-if [[ -s /etc/sysconfig/opensm ]]; then
- . /etc/sysconfig/opensm
+if [ -s /etc/sysconfig/opensm.conf ]; then
+ OPTIONS="--config /etc/sysconfig/opensm.conf"
fi
start () {
echo -n "Starting opensm: "
- @sbindir@/opensm -B $OPTIONS > /dev/null
+ @sbindir@/opensm --daemon $OPTIONS > /dev/null
if [[ $RETVAL -eq 0 ]]; then
touch /var/lock/subsys/opensm
success
diff --git a/opensm/scripts/redhat-opensm.init.in b/opensm/scripts/redhat-opensm.init.in
index aad783b..a5755ef 100755
--- a/opensm/scripts/redhat-opensm.init.in
+++ b/opensm/scripts/redhat-opensm.init.in
@@ -49,7 +49,7 @@ exec_prefix=@exec_prefix@
CONFIG=@sysconfdir@/sysconfig/opensm.conf
if [ -f $CONFIG ]; then
- . $CONFIG
+ OPTIONS="--config ${CONFIG}"
fi
prog=@sbindir@/opensm
@@ -147,7 +147,7 @@ start()
# Start opensm
echo -n "Starting IB Subnet Manager"
- $prog --daemon ${HONORE_GUID2LID} > /dev/null
+ $prog --daemon ${HONORE_GUID2LID} ${OPTIONS} > /dev/null
cnt=0; alive=0
while [ $cnt -lt 6 -a $alive -ne 1 ]; do
echo -n ".";
--
1.5.1.4
More information about the general
mailing list