Re: [ClusterLabs] Antw: Re: Antw: Need bash instead of /bin/sh
On 09/23/2015 08:38 AM, Ulrich Windl wrote: Vladislav Bogdanov schrieb am 23.09.2015 um 15:24 in > Nachricht <5602a808.1090...@hoster-ok.com>: >> 23.09.2015 15:42, dan wrote: >>> ons 2015-09-23 klockan 14:08 +0200 skrev Ulrich Windl: >>> dan schrieb am 23.09.2015 um 13:39 in >>> Nachricht <1443008370.2386.8.ca...@intraphone.com>: > Hi > > As I had problem with corosync 2.3.3 and pacemaker 1.1.10 which was > default in my version of ubuntu, I have now compiled and installed > corosync 2.3.4 and pacemaker 1.1.12. > > And now it works. > > Though the file /usr/lib/ocf/resource.d/pacemaker/controld > does not work as /bin/sh is linked to dash on ubuntu (and I think > several other Linux variants). > > It is line 182: > local addr_list=$(cat > /sys/kernel/config/dlm/cluster/comms/*/addr_list 2>/dev/null) That looks like plain POSIX shell to me. What part is causing the problem? >>> >>> Did a small test: >>> ---test.sh >>> controld_start() { >>> local addr_list=$(echo AF_INET 10.1.1.1 AF_INET 10.1.1.2) >> yep, that is a bashism. >> >> posix shell denies assignment of local variables in the declaration. > > In times of BASH it's hard to get POSIX shell documentation. The last we had > was from HP-UX. But the problem seems to be more $() than assignment it seems. Good catch, thanks. I'll submit a patch upstream. >> >> local addr_list; addr_list=$(echo AF_INET 10.1.1.1 AF_INET 10.1.1.2) >> >> should work >> >>> echo $addr_list >>> } >>> >>> controld_start >>> -- >>> >>> dash test.sh >>> test.sh: 2: local: 10.1.1.1: bad variable name >>> >>> bash test.sh >>> AF_INET 10.1.1.1 AF_INET 10.1.1.2 >>> >>> >>> Dan = ___ Users mailing list: Users@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
[ClusterLabs] Antw: Re: Antw: Need bash instead of /bin/sh
>>> Vladislav Bogdanov schrieb am 23.09.2015 um 15:24 in Nachricht <5602a808.1090...@hoster-ok.com>: > 23.09.2015 15:42, dan wrote: >> ons 2015-09-23 klockan 14:08 +0200 skrev Ulrich Windl: >> dan schrieb am 23.09.2015 um 13:39 in >> Nachricht >>> <1443008370.2386.8.ca...@intraphone.com>: Hi As I had problem with corosync 2.3.3 and pacemaker 1.1.10 which was default in my version of ubuntu, I have now compiled and installed corosync 2.3.4 and pacemaker 1.1.12. And now it works. Though the file /usr/lib/ocf/resource.d/pacemaker/controld does not work as /bin/sh is linked to dash on ubuntu (and I think several other Linux variants). It is line 182: local addr_list=$(cat /sys/kernel/config/dlm/cluster/comms/*/addr_list 2>/dev/null) >>> >>> That looks like plain POSIX shell to me. What part is causing the problem? >> >> Did a small test: >> ---test.sh >> controld_start() { >> local addr_list=$(echo AF_INET 10.1.1.1 AF_INET 10.1.1.2) > yep, that is a bashism. > > posix shell denies assignment of local variables in the declaration. In times of BASH it's hard to get POSIX shell documentation. The last we had was from HP-UX. But the problem seems to be more $() than assignment it seems. > > local addr_list; addr_list=$(echo AF_INET 10.1.1.1 AF_INET 10.1.1.2) > > should work > >> echo $addr_list >> } >> >> controld_start >> -- >> >> dash test.sh >> test.sh: 2: local: 10.1.1.1: bad variable name >> >> bash test.sh >> AF_INET 10.1.1.1 AF_INET 10.1.1.2 >> >> >> Dan >> >> >> ___ >> Users mailing list: Users@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@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@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
Re: [ClusterLabs] Antw: Re: Antw: Need bash instead of /bin/sh
ons 2015-09-23 klockan 15:20 +0200 skrev Ulrich Windl: > >>> dan schrieb am 23.09.2015 um 14:42 in > >>> Nachricht > <1443012134.2386.11.ca...@intraphone.com>: > > ons 2015-09-23 klockan 14:08 +0200 skrev Ulrich Windl: > >> >>> dan schrieb am 23.09.2015 um 13:39 in > > Nachricht > >> <1443008370.2386.8.ca...@intraphone.com>: > >> > Hi > >> > > >> > As I had problem with corosync 2.3.3 and pacemaker 1.1.10 which was > >> > default in my version of ubuntu, I have now compiled and installed > >> > corosync 2.3.4 and pacemaker 1.1.12. > >> > > >> > And now it works. > >> > > >> > Though the file /usr/lib/ocf/resource.d/pacemaker/controld > >> > does not work as /bin/sh is linked to dash on ubuntu (and I think > >> > several other Linux variants). > >> > > >> > It is line 182: > >> > local addr_list=$(cat > >> > /sys/kernel/config/dlm/cluster/comms/*/addr_list 2>/dev/null) > >> > >> That looks like plain POSIX shell to me. What part is causing the problem? > > > > Did a small test: > > ---test.sh > > controld_start() { > > local addr_list=$(echo AF_INET 10.1.1.1 AF_INET 10.1.1.2) > > I see: Dash needs quoting aound "$(...)" it seems. I tested that and now my test script works fine. > > > echo $addr_list > > } > > > > controld_start > > -- > > > > dash test.sh > > test.sh: 2: local: 10.1.1.1: bad variable name > > > > bash test.sh > > AF_INET 10.1.1.1 AF_INET 10.1.1.2 > > > > > > Dan > > > > > > ___ > > Users mailing list: Users@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@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@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
[ClusterLabs] Antw: Re: Antw: Need bash instead of /bin/sh
>>> dan schrieb am 23.09.2015 um 14:42 in >>> Nachricht <1443012134.2386.11.ca...@intraphone.com>: > ons 2015-09-23 klockan 14:08 +0200 skrev Ulrich Windl: >> >>> dan schrieb am 23.09.2015 um 13:39 in > Nachricht >> <1443008370.2386.8.ca...@intraphone.com>: >> > Hi >> > >> > As I had problem with corosync 2.3.3 and pacemaker 1.1.10 which was >> > default in my version of ubuntu, I have now compiled and installed >> > corosync 2.3.4 and pacemaker 1.1.12. >> > >> > And now it works. >> > >> > Though the file /usr/lib/ocf/resource.d/pacemaker/controld >> > does not work as /bin/sh is linked to dash on ubuntu (and I think >> > several other Linux variants). >> > >> > It is line 182: >> > local addr_list=$(cat >> > /sys/kernel/config/dlm/cluster/comms/*/addr_list 2>/dev/null) >> >> That looks like plain POSIX shell to me. What part is causing the problem? > > Did a small test: > ---test.sh > controld_start() { > local addr_list=$(echo AF_INET 10.1.1.1 AF_INET 10.1.1.2) I see: Dash needs quoting aound "$(...)" it seems. > echo $addr_list > } > > controld_start > -- > > dash test.sh > test.sh: 2: local: 10.1.1.1: bad variable name > > bash test.sh > AF_INET 10.1.1.1 AF_INET 10.1.1.2 > > > Dan > > > ___ > Users mailing list: Users@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@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