[ 
https://issues.apache.org/jira/browse/SOLR-7067?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Steve Rowe updated SOLR-7067:
-----------------------------
    Attachment: SOLR-7067.patch

Updated patch.

[~thelabdude] told me offline that with the original patch, {{bin/solr 
healthcheck -c whatever}} fails when the war has not yet been unpacked.  I 
reproduced:

{noformat}
$ bin/solr healthcheck -c testing
bin/solr: line 386: 
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/jar xf: No 
such file or directory
Error: Could not find or load main class org.apache.solr.util.SolrCLI
{noformat}

This patch fixes that problem, and also switches from using {{command -v}} to 
{{hash}} to check for executables, which the above-linked SO answer says is the 
best way from bash scripts (which {{bin/solr}} is).

This patch also renames {{$unzipCommand}} to {{$UNPACK_WAR_CMD}}, and adds 
{{-q}} to the {{unzip}} command, so that it's quiet (like {{jar xf}} is).

> bin/solr won't run under bash 4.3 (OS X 10.10.2)
> ------------------------------------------------
>
>                 Key: SOLR-7067
>                 URL: https://issues.apache.org/jira/browse/SOLR-7067
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 5.0, Trunk, 5.1
>            Reporter: Steve Rowe
>            Assignee: Steve Rowe
>            Priority: Blocker
>             Fix For: 5.0, Trunk, 5.1
>
>         Attachments: SOLR-7067.patch, SOLR-7067.patch
>
>
> I upgraded to OS X Yosemite 10.10.2 today, and the bash version went from 
> {{3.2.53(1)-release (x86_64-apple-darwin14)}} on 10.10.1 to 
> {{4.3.30(1)-release (x86_64-apple-darwin14.0.0)}}.
> When I try to run {{bin/solr}}, I get:
> {noformat}
> bin/solr: line 55: [: is: binary operator expected
> bin/solr: line 58: [: is: binary operator expected
> This script requires extracting a WAR file with either the jar or unzip 
> utility, please install these utilities or contact your administrator for 
> assistance.
> {noformat}
> the relevant section of the script is:
> {code}
> 52: hasJar=$(which jar 2>/dev/null)
> 53: hasUnzip=$(which unzip 2>/dev/null)
> 54: 
> 55: if [ ${hasJar} ]; then
> 56:   unzipCommand="$hasJar xf"
> 57: else
> 58:   if [ ${hasUnzip} ]; then
> 59:     unzipCommand="$hasUnzip"
> 60:   else
> 61:     echo -e "This script requires extracting a WAR file with either the 
> jar or unzip utility, please install these utilities or contact your 
> administrator for assistance."
> 62:     exit 1
> 63:   fi
> 64: fi
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to