[
https://issues.apache.org/jira/browse/KARAF-4566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15321508#comment-15321508
]
ASF GitHub Bot commented on KARAF-4566:
---------------------------------------
GitHub user adetalhouet opened a pull request:
https://github.com/apache/karaf/pull/197
KARAF-4566 "karaf" script invokes /bin/sh but requires /bin/bash functions
The bin/karaf script uses the "local" command which is a shell builtin of
bash and similar shells, but is not required for POSIX-compliance in sh. When I
attempt to run karaf on a Solaris system, I see the following output:
root@solaris:/opendaylight/bin# ./karaf
./karaf[172]: local: not found [No such file or directory]
./karaf[182]: local: not found [No such file or directory]
./karaf[183]: local: not found [No such file or directory]
Lines 172, 182 and 183 invoke "local" to make local variables to the
function. According to "man bash", this is a shell builtin. However, bin/karaf
is invoked as:
#!/bin/sh
On most flavors of linux, this resolves to bash or dash which probably runs
in a restricted environment after checking to see that its $0 is sh. But on
Solaris's /bin/sh is actually ksh93 for backwards compatibility.
Since "local" is not part of a POSIX-compliant /bin/sh, depending on it in
a script that is invoked with /bin/sh is a bug.
(this explaination is borrowed from
https://issues.apache.org/jira/browse/MNG-5852)
Signed-off-by: Alexis de Talhouët <[email protected]>
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/adetalhouet/karaf solaris-bash-local
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/karaf/pull/197.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #197
----
commit bbbb9469d4a30d21d8c0418d1200d93e8951a8f9
Author: Alexis de Talhouët <[email protected]>
Date: 2016-06-08T21:51:18Z
KARAF-4566 "karaf" script invokes /bin/sh but requires /bin/bash functions
Signed-off-by: Alexis de Talhouët <[email protected]>
----
> "karaf" script invokes /bin/sh but requires /bin/bash functions
> ----------------------------------------------------------------
>
> Key: KARAF-4566
> URL: https://issues.apache.org/jira/browse/KARAF-4566
> Project: Karaf
> Issue Type: Bug
> Components: karaf-core
> Affects Versions: 3.0.6
> Environment: Solaris (SunOS solaris11.3 5.11 11.3 i86pc i386 i86pc)
> Reporter: Alexis de Talhouët
>
> The bin/karaf script uses the "local" command which is a shell builtin of
> bash and similar shells, but is not required for POSIX-compliance in sh. When
> I attempt to run karaf on a Solaris system, I see the following output:
> root@solaris:/opendaylight/bin# ./karaf
> ./karaf[172]: local: not found [No such file or directory]
> ./karaf[182]: local: not found [No such file or directory]
> ./karaf[183]: local: not found [No such file or directory]
> Lines 172, 182 and 183 invoke "local" to make local variables to the
> function. According to "man bash", this is a shell builtin. However,
> bin/karaf is invoked as:
> #!/bin/sh
> On most flavors of linux, this resolves to bash or dash which probably runs
> in a restricted environment after checking to see that its $0 is sh. But on
> Solaris's /bin/sh is actually ksh93 for backwards compatibility.
> Since "local" is not part of a POSIX-compliant /bin/sh, depending on it in a
> script that is invoked with /bin/sh is a bug.
> (this explaination is borrowed from
> https://issues.apache.org/jira/browse/MNG-5852)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)