<div style="font-family: Arial; font-size: 13;">Hi Ken,</div><div style="font-family: Arial; font-size: 13;"><br></div><div style="font-family: Arial; font-size: 13;">I have been talking with the illumos guys about the shell problem.</div><div style="font-family: Arial; font-size: 13;">They all agreed that ksh (and specially the ksh93 used in illumos) is absolutely Bourne-compatible, and that the &quot;local&quot; variables used in the ocf shells is not a Bourne syntax, but probably a bash specific.</div><div style="font-family: Arial; font-size: 13;">This means that pointing the scripts to &quot;#!/bin/sh&quot; is portable as long as the scripts are really Bourne-shell only syntax, as any Unix variant may link whatever Bourne-shell they like.</div><div style="font-family: Arial; font-size: 13;">In this case, it should point to &quot;#!/bin/bash&quot; or whatever shell the script was written for.</div><div style="font-family: Arial; font-size: 13;">Also, in this case, the starting point is not the ocf-* script, but the original RA (IPaddr, but almost all of them).</div><div style="font-family: Arial; font-size: 13;"><br></div><div style="font-family: Arial; font-size: 13;">What about making the code base of RA and ocf-* portable?</div><div style="font-family: Arial; font-size: 13;">It may be just by changing them to point to bash, or with some kind of configure modifier to be able to specify the shell to use.</div><div style="font-family: Arial; font-size: 13;"><br></div><div style="font-family: Arial; font-size: 13;">Meanwhile, changing the scripts by hands into #!/bin/bash worked like a charm, and I will start patching.</div><div style="font-family: Arial; font-size: 13;"><br></div><div style="font-family: Arial; font-size: 13;">Gabriele</div><div style="font-family: Arial; font-size: 13;"><br><div id="wt-mailcard"><div style="font-family: Arial;">----------------------------------------------------------------------------------------<br></div><div style="font-family: Arial;"><b>Sonicle S.r.l. </b>: <a href="http://www.sonicle.com/" target="_new">http://www.sonicle.com</a></div><div style="font-family: Arial;"><b>Music: </b><a href="http://www.gabrielebulfon.com/" target="_new">http://www.gabrielebulfon.com</a></div><div style="font-family: Arial;"><b>Quantum Mechanics : </b><a href="http://www.cdbaby.com/cd/gabrielebulfon" target="_new">http://www.cdbaby.com/cd/gabrielebulfon</a></div></div><tt><br><br><br>----------------------------------------------------------------------------------<br><br>Da: Ken Gaillot &lt;kgaillot@redhat.com&gt;<br>A: gbulfon@sonicle.com Cluster Labs - All topics related to open-source clustering welcomed &lt;users@clusterlabs.org&gt; <br>Data: 26 agosto 2016 15.56.02 CEST<br>Oggetto: Re: ocf scripts shell and local variables<br><br></tt><blockquote style="BORDER-LEFT: #000080 2px solid; MARGIN-LEFT: 5px; PADDING-LEFT: 5px"><tt>On 08/26/2016 08:11 AM, Gabriele Bulfon wrote:<br>&gt; I tried adding some debug in ocf-shellfuncs, showing env and ps -ef into<br>&gt; the corosync.log<br>&gt; I suspect it&#39;s always using ksh, because in the env output I produced I<br>&gt; find this: KSH_VERSION=.sh.version<br>&gt; This is normally not present in the environment, unless ksh is running<br>&gt; the shell.<br><br>The RAs typically start with #!/bin/sh, so whatever that points to on<br>your system is what will be used.<br><br>&gt; I also tried modifiying all ocf shells with &quot;#!/usr/bin/bash&quot; at the<br>&gt; beginning, no way, same output.<br><br>You&#39;d have to change the RA that includes them.<br><br>&gt; Any idea how can I change the used shell to support &quot;local&quot; variables?<br><br>You can either edit the #!/bin/sh line at the top of each RA, or figure<br>out how to point /bin/sh to a Bourne-compatible shell. ksh isn&#39;t<br>Bourne-compatible, so I&#39;d expect lots of #!/bin/sh scripts to fail with<br>it as the default shell.<br><br>&gt; Gabriele<br>&gt; <br>&gt; ----------------------------------------------------------------------------------------<br>&gt; *Sonicle S.r.l. *: http://www.sonicle.com &lt;http://www.sonicle.com/&gt;<br>&gt; *Music: *http://www.gabrielebulfon.com &lt;http://www.gabrielebulfon.com/&gt;<br>&gt; *Quantum Mechanics : *http://www.cdbaby.com/cd/gabrielebulfon<br>&gt; <br>&gt; ------------------------------------------------------------------------<br>&gt; <br>&gt; <br>&gt; *Da:* Gabriele Bulfon &lt;gbulfon@sonicle.com&gt;<br>&gt; *A:* kgaillot@redhat.com Cluster Labs - All topics related to<br>&gt; open-source clustering welcomed &lt;users@clusterlabs.org&gt;<br>&gt; *Data:* 26 agosto 2016 10.12.13 CEST<br>&gt; *Oggetto:* Re: [ClusterLabs] ocf::heartbeat:IPaddr<br>&gt; <br>&gt; <br>&gt;     I looked around what you suggested, inside ocf-binaris and<br>&gt;     ocf-shellfuncs etc.<br>&gt;     So I found also these logs in corosync.log :<br>&gt; <br>&gt;     Aug 25 17:50:33 [2250] crmd: notice: process_lrm_event:<br>&gt;     xstorage1-xstorage2_wan2_IP_start_0:22 [<br>&gt;     /usr/lib/ocf/resource.d/heartbeat/IPaddr[71]: local: not found [No<br>&gt;     such file or<br>&gt;     directory]\n/usr/lib/ocf/resource.d/heartbeat/IPaddr[354]: local:<br>&gt;     not found [No such file or<br>&gt;     directory]\n/usr/lib/ocf/resource.d/heartbeat/IPaddr[355]: local:<br>&gt;     not found [No such file or<br>&gt;     directory]\n/usr/lib/ocf/resource.d/heartbeat/IPaddr[356]: local:<br>&gt;     not found [No such file or directory]\nocf-exit-reason:Setup<br>&gt;     problem: coul<br>&gt; <br>&gt;     Aug 25 17:50:33 [2246] lrmd: notice: operation_finished:<br>&gt;     xstorage2_wan2_IP_start_0:3613:stderr [<br>&gt;     /usr/lib/ocf/resource.d/heartbeat/IPaddr[71]: local: not found [No<br>&gt;     such file or directory] ]<br>&gt; <br>&gt;     Looks like the shell is not happy with the &quot;local&quot; variable definition.<br>&gt;     I tried running ocf-shellfuncs manually with sh and bash and they<br>&gt;     all run without errors.<br>&gt;     How can I see what shell is running these scripts?<br>&gt; <br>&gt;     ----------------------------------------------------------------------------------------<br>&gt;     *Sonicle S.r.l. *: http://www.sonicle.com &lt;http://www.sonicle.com/&gt;<br>&gt;     *Music: *http://www.gabrielebulfon.com &lt;http://www.gabrielebulfon.com/&gt;<br>&gt;     *Quantum Mechanics : *http://www.cdbaby.com/cd/gabrielebulfon<br>&gt; <br>&gt; <br>&gt; <br>&gt;     ----------------------------------------------------------------------------------<br>&gt; <br>&gt;     Da: Ken Gaillot &lt;kgaillot@redhat.com&gt;<br>&gt;     A: users@clusterlabs.org<br>&gt;     Data: 25 agosto 2016 18.07.42 CEST<br>&gt;     Oggetto: Re: [ClusterLabs] ocf::heartbeat:IPaddr<br>&gt; <br>&gt;         On 08/25/2016 10:51 AM, Gabriele Bulfon wrote:<br>&gt;         &gt; Hi,<br>&gt;         &gt;<br>&gt;         &gt; I&#39;m advancing with this monster cluster on XStreamOS/illumos ;)<br>&gt;         &gt;<br>&gt;         &gt; In the previous older tests I used heartbeat, and I had these<br>&gt;         lines to<br>&gt;         &gt; take care of the swapping public IP addresses:<br>&gt;         &gt;<br>&gt;         &gt; primitive xstorage1_wan1_IP ocf:heartbeat:IPaddr params<br>&gt;         ip=&quot;1.2.3.4&quot;<br>&gt;         &gt; cidr_netmask=&quot;255.255.255.0&quot; nic=&quot;e1000g1&quot;<br>&gt;         &gt; primitive xstorage2_wan2_IP ocf:heartbeat:IPaddr params<br>&gt;         ip=&quot;1.2.3.5&quot;<br>&gt;         &gt; cidr_netmask=&quot;255.255.255.0&quot; nic=&quot;e1000g1&quot;<br>&gt;         &gt;<br>&gt;         &gt; location xstorage1_wan1_IP_pref xstorage1_wan1_IP 100: xstorage1<br>&gt;         &gt; location xstorage2_wan2_IP_pref xstorage2_wan2_IP 100: xstorage2<br>&gt;         &gt;<br>&gt;         &gt; They get configured, but then I get this in crm status:<br>&gt;         &gt;<br>&gt;         &gt; xstorage1_wan1_IP (ocf::heartbeat:IPaddr): Stopped<br>&gt;         &gt; xstorage2_wan2_IP (ocf::heartbeat:IPaddr): Stopped<br>&gt;         &gt;<br>&gt;         &gt; Failed Actions:<br>&gt;         &gt; * xstorage1_wan1_IP_start_0 on xstorage1 &#39;not installed&#39; (5):<br>&gt;         call=20,<br>&gt;         &gt; status=complete, exitreason=&#39;Setup problem: couldn&#39;t find command:<br>&gt;         &gt; /usr/bin/gawk&#39;,<br>&gt;         &gt; last-rc-change=&#39;Thu Aug 25 17:50:32 2016&#39;, queued=1ms, exec=158ms<br>&gt;         &gt; * xstorage2_wan2_IP_start_0 on xstorage1 &#39;not installed&#39; (5):<br>&gt;         call=22,<br>&gt;         &gt; status=complete, exitreason=&#39;Setup problem: couldn&#39;t find command:<br>&gt;         &gt; /usr/bin/gawk&#39;,<br>&gt;         &gt; last-rc-change=&#39;Thu Aug 25 17:50:33 2016&#39;, queued=1ms, exec=29ms<br>&gt;         &gt; * xstorage1_wan1_IP_start_0 on xstorage2 &#39;not installed&#39; (5):<br>&gt;         call=22,<br>&gt;         &gt; status=complete, exitreason=&#39;Setup problem: couldn&#39;t find command:<br>&gt;         &gt; /usr/bin/gawk&#39;,<br>&gt;         &gt; last-rc-change=&#39;Thu Aug 25 17:50:30 2016&#39;, queued=1ms, exec=36ms<br>&gt;         &gt; * xstorage2_wan2_IP_start_0 on xstorage2 &#39;not installed&#39; (5):<br>&gt;         call=20,<br>&gt;         &gt; status=complete, exitreason=&#39;Setup problem: couldn&#39;t find command:<br>&gt;         &gt; /usr/bin/gawk&#39;,<br>&gt;         &gt; last-rc-change=&#39;Thu Aug 25 17:50:29 2016&#39;, queued=0ms, exec=150ms<br>&gt;         &gt;<br>&gt;         &gt;<br>&gt;         &gt; The crm configure process already checked of the presence of the<br>&gt;         &gt; required IPaddr shell, and it was ok.<br>&gt;         &gt; Now looks like it&#39;s looking for &quot;/usr/bin/gawk&quot;, and that is<br>&gt;         actually there!<br>&gt;         &gt; Is there any known incompatibility with the mixed heartbeat<br>&gt;         ocf ? Should<br>&gt;         &gt; I use corosync specific ocf files or something else?<br>&gt; <br>&gt;         &quot;heartbeat&quot; in this case is just an OCF provider name, and has<br>&gt;         nothing<br>&gt;         to do with the heartbeat messaging layer, other than having its<br>&gt;         origin<br>&gt;         in the same project. There actually has been a recent proposal<br>&gt;         to rename<br>&gt;         the provider to &quot;clusterlabs&quot; to better reflect the current reality.<br>&gt; <br>&gt;         The &quot;couldn&#39;t find command&quot; message comes from the ocf-binaries<br>&gt;         shell<br>&gt;         functions. If you look at have_binary() there, it uses sed and<br>&gt;         which,<br>&gt;         and I&#39;m guessing that fails on your OS somehow. You may need to<br>&gt;         patch it.<br>&gt; <br>&gt;         &gt; Thanks again!<br>&gt;         &gt;<br>&gt;         &gt; Gabriele<br>&gt;         &gt;<br>&gt;         &gt;<br>&gt;         ----------------------------------------------------------------------------------------<br>&gt;         &gt; *Sonicle S.r.l. *: http://www.sonicle.com<br>&gt;         &lt;http://www.sonicle.com/&gt;<br>&gt;         &gt; *Music: *http://www.gabrielebulfon.com<br>&gt;         &lt;http://www.gabrielebulfon.com/&gt;<br>&gt;         &gt; *Quantum Mechanics : *http://www.cdbaby.com/cd/gabrielebulfon<br><br><br></tt></blockquote></div>