[ofa-general] Re: [PATCH] opensm/scripts: handling opensm config file

Sasha Khapyorsky sashak at voltaire.com
Wed Oct 22 08:22:46 PDT 2008


On 16:57 Wed 22 Oct     , Yevgeny Kliteynik wrote:
> 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"

Why we should specify OpenSM config file explicitly? It has the default
location (/etc/opensm/opensm.conf or something).

It is not the same as /etc/sysconfig/blahblah script where $OPTIONS
environment variable could be defined.

Again, I'm fine with removing all this /etc/sysconfig/* stuff completely
if nobody uses this.

Sasha

>  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