[ClusterLabs] ocf scripts shell and local variables

Gabriele Bulfon gbulfon at sonicle.com
Fri Aug 26 09:11:17 EDT 2016


I tried adding some debug in ocf-shellfuncs, showing env and ps -ef into the corosync.log
I suspect it's always using ksh, because in the env output I produced I find this: KSH_VERSION=.sh.version
This is normally not present in the environment, unless ksh is running the shell.
I also tried modifiying all ocf shells with "#!/usr/bin/bash" at the beginning, no way, same output.
Any idea how can I change the used shell to support "local" variables?
Gabriele
----------------------------------------------------------------------------------------
Sonicle S.r.l.
:
http://www.sonicle.com
Music:
http://www.gabrielebulfon.com
Quantum Mechanics :
http://www.cdbaby.com/cd/gabrielebulfon
Da:
Gabriele Bulfon
A:
kgaillot at redhat.com Cluster Labs - All topics related to open-source clustering welcomed
Data:
26 agosto 2016 10.12.13 CEST
Oggetto:
Re: [ClusterLabs] ocf::heartbeat:IPaddr
I looked around what you suggested, inside ocf-binaris and ocf-shellfuncs etc.
So I found also these logs in corosync.log :
Aug 25 17:50:33 [2250]       crmd:   notice: process_lrm_event: xstorage1-xstorage2_wan2_IP_start_0:22 [ /usr/lib/ocf/resource.d/heartbeat/IPaddr[71]: local: not found [No such file or directory]\n/usr/lib/ocf/resource.d/heartbeat/IPaddr[354]: local: not found [No such file or directory]\n/usr/lib/ocf/resource.d/heartbeat/IPaddr[355]: local: not found [No such file or directory]\n/usr/lib/ocf/resource.d/heartbeat/IPaddr[356]: local: not found [No such file or directory]\nocf-exit-reason:Setup problem: coul
Aug 25 17:50:33 [2246]       lrmd:   notice: operation_finished:        xstorage2_wan2_IP_start_0:3613:stderr [ /usr/lib/ocf/resource.d/heartbeat/IPaddr[71]: local: not found [No such file or directory] ]
Looks like the shell is not happy with the "local" variable definition.
I tried running ocf-shellfuncs manually with sh and bash and they all run without errors.
How can I see what shell is running these scripts?
----------------------------------------------------------------------------------------
Sonicle S.r.l.
:
http://www.sonicle.com
Music:
http://www.gabrielebulfon.com
Quantum Mechanics :
http://www.cdbaby.com/cd/gabrielebulfon
----------------------------------------------------------------------------------
Da: Ken Gaillot
A: users at clusterlabs.org
Data: 25 agosto 2016 18.07.42 CEST
Oggetto: Re: [ClusterLabs] ocf::heartbeat:IPaddr
On 08/25/2016 10:51 AM, Gabriele Bulfon wrote:
Hi,
I'm advancing with this monster cluster on XStreamOS/illumos ;)
In the previous older tests I used heartbeat, and I had these lines to
take care of the swapping public IP addresses:
primitive xstorage1_wan1_IP ocf:heartbeat:IPaddr params ip="1.2.3.4"
cidr_netmask="255.255.255.0" nic="e1000g1"
primitive xstorage2_wan2_IP ocf:heartbeat:IPaddr params ip="1.2.3.5"
cidr_netmask="255.255.255.0" nic="e1000g1"
location xstorage1_wan1_IP_pref xstorage1_wan1_IP 100: xstorage1
location xstorage2_wan2_IP_pref xstorage2_wan2_IP 100: xstorage2
They get configured, but then I get this in crm status:
xstorage1_wan1_IP (ocf::heartbeat:IPaddr): Stopped
xstorage2_wan2_IP (ocf::heartbeat:IPaddr): Stopped
Failed Actions:
* xstorage1_wan1_IP_start_0 on xstorage1 'not installed' (5): call=20,
status=complete, exitreason='Setup problem: couldn't find command:
/usr/bin/gawk',
last-rc-change='Thu Aug 25 17:50:32 2016', queued=1ms, exec=158ms
* xstorage2_wan2_IP_start_0 on xstorage1 'not installed' (5): call=22,
status=complete, exitreason='Setup problem: couldn't find command:
/usr/bin/gawk',
last-rc-change='Thu Aug 25 17:50:33 2016', queued=1ms, exec=29ms
* xstorage1_wan1_IP_start_0 on xstorage2 'not installed' (5): call=22,
status=complete, exitreason='Setup problem: couldn't find command:
/usr/bin/gawk',
last-rc-change='Thu Aug 25 17:50:30 2016', queued=1ms, exec=36ms
* xstorage2_wan2_IP_start_0 on xstorage2 'not installed' (5): call=20,
status=complete, exitreason='Setup problem: couldn't find command:
/usr/bin/gawk',
last-rc-change='Thu Aug 25 17:50:29 2016', queued=0ms, exec=150ms
The crm configure process already checked of the presence of the
required IPaddr shell, and it was ok.
Now looks like it's looking for "/usr/bin/gawk", and that is actually there!
Is there any known incompatibility with the mixed heartbeat ocf ? Should
I use corosync specific ocf files or something else?
"heartbeat" in this case is just an OCF provider name, and has nothing
to do with the heartbeat messaging layer, other than having its origin
in the same project. There actually has been a recent proposal to rename
the provider to "clusterlabs" to better reflect the current reality.
The "couldn't find command" message comes from the ocf-binaries shell
functions. If you look at have_binary() there, it uses sed and which,
and I'm guessing that fails on your OS somehow. You may need to patch it.
Thanks again!
Gabriele
----------------------------------------------------------------------------------------
*Sonicle S.r.l. *: http://www.sonicle.com
*Music: *http://www.gabrielebulfon.com
*Quantum Mechanics : *http://www.cdbaby.com/cd/gabrielebulfon
_______________________________________________
Users mailing list: Users at clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users
Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org
_______________________________________________Users mailing list: Users at clusterlabs.orghttp://clusterlabs.org/mailman/listinfo/usersProject Home: http://www.clusterlabs.orgGetting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdfBugs: http://bugs.clusterlabs.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20160826/ffa68698/attachment-0003.html>


More information about the Users mailing list