You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/06/21 14:53:00 UTC

[jira] [Commented] (KARAF-5190) start.sh fails in realpath function under Solaris 10

    [ https://issues.apache.org/jira/browse/KARAF-5190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16519454#comment-16519454 ] 

ASF GitHub Bot commented on KARAF-5190:
---------------------------------------

baptistedaroit opened a new pull request #533: [KARAF-5190] Enhance realpath() function to better manage awk on Solaris
URL: https://github.com/apache/karaf/pull/533
 
 
   This PR aims to update and normalize the `realpath()` function included in Karaf shell scripts (karaf, shell, start, stop, status, instance, client) , making them compatible with Solaris platforms.
   
   For exemple, until now, launching the `start` script on Solaris resulted in a loop caused by bad behavior of default Solaris awk command, which is not able to properly manage the `-F"-> "` delimiter.
   
   It also cleans the `checkJvmVersion()` function to make the `awk` command configuration inside it identical to the one in newly updated `realpath()`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> start.sh fails in realpath function under Solaris 10
> ----------------------------------------------------
>
>                 Key: KARAF-5190
>                 URL: https://issues.apache.org/jira/browse/KARAF-5190
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.0.9
>         Environment: SunOS 5.10 (aka Solaris 10) SPARC, awk from /usr/bin
>            Reporter: Christian Brüssow
>            Priority: Major
>
> Trying to start Apache Karaf 4.0.9 under Solaris 10 (SPARC) the start-script exits with a syntax error:
> {quote}
> $ /opt/test/karaf/bin/start: syntax error at line 22: `LINK=$' unexpected
> {quote}
> I have investigated this and found, the script relies on a feature the standard awk for this plattform does not support - at least on our machine. The \-F"\-> " paramter will only use the dash "\-" as the field separator. When using the XPG4 version of awk the script works.
> Examples on the command line:
> With XPG4 awk:
> {quote}
> $ ls \-l "$(basename ".bashrc")" | /usr/xpg4/bin/awk \-F"\-> " '\{print $2\}'
> $ 
> {quote}
> Empty output, which is fine as the file used is no link.
> With the standard awk:
> {quote}
> $ ls \-l "$(basename ".bashrc")" | /usr/bin/awk \-F"\-> " '\{print $2\}'
> rw
> $
> {quote}
> The "rw" is returned, because only the dash is used as a seperator to split "ls \-l .bashrc" which looks like
> {quote}
> \-rw\-r\-\-r\-\-   1 devel    other        392 Jun 30  2015 .bashrc
> {quote}
> in this case.
> Sadly, under Solaris, one should not presume the awk in the PATH is a GNU or nawk. Some adminstrator will also not include the XPG4 "bin"-directory at the beginning of the PATH. So the script itfself must handle this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)