Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

[PATCH] specify the full path for ipmi command

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


tsukishima.ha at gmail

Aug 15, 2011, 9:43 PM

Post #1 of 6 (551 views)
Permalink
[PATCH] specify the full path for ipmi command

Hi,

I attached a small patch for external/ipmi to specify the full path of
"ipmitool"
There might be a much better way, for example, refer to user's $PATH,
but I encountered the following issue.
http://www.gossamer-threads.com/lists/linuxha/pacemaker/74350

Would you please give me some advices?

Best Regards,
Junko IKEDA

NTT DATA INTELLILINK CORPORATION
Attachments: ipmi.patch (0.75 KB)


dejan at suse

Aug 16, 2011, 7:31 AM

Post #2 of 6 (543 views)
Permalink
Re: [PATCH] specify the full path for ipmi command [In reply to]

Hi Junko-san,

On Tue, Aug 16, 2011 at 01:43:02PM +0900, Junko IKEDA wrote:
> Hi,
>
> I attached a small patch for external/ipmi to specify the full path of
> "ipmitool"
> There might be a much better way, for example, refer to user's $PATH,
> but I encountered the following issue.
> http://www.gossamer-threads.com/lists/linuxha/pacemaker/74350

I don't see the connection between the two.

> Would you please give me some advices?

We can apply the patch you sent. But could you please choose a
different name for the parameter, say just "ipmitool", or
perhaps "ipmitool_path". "command" seems too generic to me.

> diff -r ea850bf2e35e lib/plugins/stonith/external/ipmi
> --- a/lib/plugins/stonith/external/ipmi Sat Aug 06 01:37:34 2011 +0200
> +++ b/lib/plugins/stonith/external/ipmi Tue Aug 16 11:41:15 2011 +0900
> @@ -39,7 +39,12 @@
> IPMITOOL=`which ipmitool 2>/dev/null`
>
> have_ipmi() {
> - test -x "${IPMITOOL}"
> + if [ -z "${command}" ]
> + then
> + test -x "${IPMITOOL}"
> + else
> + IPMITOOL=${command}
> + fi

This makes the have_ipmi() do a different thing. Why not just
leave it as it is and do sth like this above:

IPMITOOL=${ipmitool:-"`which ipmitool 2>/dev/null`}

> }
>
> # Wrapper function for ipmitool that sets the correct host IP address,
> @@ -237,6 +242,16 @@
> </longdesc>
> </parameter>
>
> +<parameter name="command" unique="0">
> +<content type="string" default="lan"/>

default is actually empty.

Cheers,

Dejan

> +<shortdesc lang="en">
> +IPMI command
> +</shortdesc>
> +<longdesc lang="en">
> +Specify the full path to IPMI command.
> +</longdesc>
> +</parameter>
> +
> </parameters>
> IPMIXML
> exit 0

> Best Regards,
> Junko IKEDA
>
> NTT DATA INTELLILINK CORPORATION


> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


tsukishima.ha at gmail

Aug 16, 2011, 6:22 PM

Post #3 of 6 (529 views)
Permalink
Re: [PATCH] specify the full path for ipmi command [In reply to]

Hi Dejan,

Thank you for your reply!
I attached the revised patch.

>> http://www.gossamer-threads.com/lists/linuxha/pacemaker/74350
>
> I don't see the connection between the two.

I am trying to use "/tmp/ipmitool" command for some tests,
and add its path for root.
so $PATH for root is here;

# echo $PATH
/tmp:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

# which ipmitool
/tmp/ipmitool

but external/ipmi could not search "/tmp/ipmitool".
It seems that external/ipmi set $PATH as
"/usr/share/cluster-glue:/sbin:/usr/sbin:/bin:/usr/bin".

I tought that it might be simple to specify its full path at crm configure,
so I made the above patch.

Thanks,
Junko
Attachments: ipmi.patch (0.71 KB)


dejan at suse

Sep 21, 2011, 8:14 AM

Post #4 of 6 (457 views)
Permalink
Re: [PATCH] specify the full path for ipmi command [In reply to]

Hi Junko-san,

On Wed, Aug 17, 2011 at 10:22:40AM +0900, Junko IKEDA wrote:
> Hi Dejan,
>
> Thank you for your reply!
> I attached the revised patch.

Just applied your patch. Sorry for the delay, this post got
somehow lost.

Cheers,

Dejan

> >> http://www.gossamer-threads.com/lists/linuxha/pacemaker/74350
> >
> > I don't see the connection between the two.
>
> I am trying to use "/tmp/ipmitool" command for some tests,
> and add its path for root.
> so $PATH for root is here;
>
> # echo $PATH
> /tmp:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
>
> # which ipmitool
> /tmp/ipmitool
>
> but external/ipmi could not search "/tmp/ipmitool".
> It seems that external/ipmi set $PATH as
> "/usr/share/cluster-glue:/sbin:/usr/sbin:/bin:/usr/bin".
>
> I tought that it might be simple to specify its full path at crm configure,
> so I made the above patch.
>
> Thanks,
> Junko


> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


tsukishima.ha at gmail

Sep 26, 2011, 9:36 PM

Post #5 of 6 (448 views)
Permalink
Re: [PATCH] specify the full path for ipmi command [In reply to]

Hi Dejan,

Many thanks!
Can I get it from http://hg.linux-ha.org/glue/ ?

Regards,
Junko

2011/9/22 Dejan Muhamedagic <dejan [at] suse>:
> Hi Junko-san,
>
> On Wed, Aug 17, 2011 at 10:22:40AM +0900, Junko IKEDA wrote:
>> Hi Dejan,
>>
>> Thank you for your reply!
>> I attached the revised patch.
>
> Just applied your patch. Sorry for the delay, this post got
> somehow lost.
>
> Cheers,
>
> Dejan
>
>> >> http://www.gossamer-threads.com/lists/linuxha/pacemaker/74350
>> >
>> > I don't see the connection between the two.
>>
>> I am trying to use "/tmp/ipmitool" command for some tests,
>> and add its path for root.
>> so $PATH for root is here;
>>
>> # echo $PATH
>> /tmp:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
>>
>> # which ipmitool
>> /tmp/ipmitool
>>
>> but external/ipmi could not search "/tmp/ipmitool".
>> It seems that external/ipmi set $PATH as
>> "/usr/share/cluster-glue:/sbin:/usr/sbin:/bin:/usr/bin".
>>
>> I tought that it might be simple to specify its full path at crm configure,
>> so I made the above patch.
>>
>> Thanks,
>> Junko
>
>
>> _______________________________________________________
>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>> Home Page: http://linux-ha.org/
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejan at suse

Sep 27, 2011, 1:40 AM

Post #6 of 6 (452 views)
Permalink
Re: [PATCH] specify the full path for ipmi command [In reply to]

Hi Junko-san,

On Tue, Sep 27, 2011 at 01:36:08PM +0900, Junko IKEDA wrote:
> Hi Dejan,
>
> Many thanks!
> Can I get it from http://hg.linux-ha.org/glue/ ?

Yes. Forgot to do hg push ;-) Pushed it just now.

Cheers,

Dejan

> Regards,
> Junko
>
> 2011/9/22 Dejan Muhamedagic <dejan [at] suse>:
> > Hi Junko-san,
> >
> > On Wed, Aug 17, 2011 at 10:22:40AM +0900, Junko IKEDA wrote:
> >> Hi Dejan,
> >>
> >> Thank you for your reply!
> >> I attached the revised patch.
> >
> > Just applied your patch. Sorry for the delay, this post got
> > somehow lost.
> >
> > Cheers,
> >
> > Dejan
> >
> >> >> http://www.gossamer-threads.com/lists/linuxha/pacemaker/74350
> >> >
> >> > I don't see the connection between the two.
> >>
> >> I am trying to use "/tmp/ipmitool" command for some tests,
> >> and add its path for root.
> >> so $PATH for root is here;
> >>
> >> # echo $PATH
> >> /tmp:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
> >>
> >> # which ipmitool
> >> /tmp/ipmitool
> >>
> >> but external/ipmi could not search "/tmp/ipmitool".
> >> It seems that external/ipmi set $PATH as
> >> "/usr/share/cluster-glue:/sbin:/usr/sbin:/bin:/usr/bin".
> >>
> >> I tought that it might be simple to specify its full path at crm configure,
> >> so I made the above patch.
> >>
> >> Thanks,
> >> Junko
> >
> >
> >> _______________________________________________________
> >> Linux-HA-Dev: Linux-HA-Dev [at] lists
> >> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> >> Home Page: http://linux-ha.org/
> >
> > _______________________________________________________
> > Linux-HA-Dev: Linux-HA-Dev [at] lists
> > http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> > Home Page: http://linux-ha.org/
> >
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.