Bug 1145683
Summary: | rhqctl install on Solaris 10 displays - ./cassandra: test: unknown operator > | ||
---|---|---|---|
Product: | [JBoss] JBoss Operations Network | Reporter: | Sunil Kondkar <skondkar> |
Component: | Installer | Assignee: | RHQ Project Maintainer <rhq-maint> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Sunil Kondkar <skondkar> |
Severity: | urgent | Docs Contact: | |
Priority: | unspecified | ||
Version: | JON 3.3.0 | CC: | jsanda, mazz |
Target Milestone: | ER05 | ||
Target Release: | JON 3.3.0 | ||
Hardware: | x86_64 | ||
OS: | Solaris | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-12-11 14:03:11 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Sunil Kondkar
2014-09-23 13:48:17 UTC
Setting this to ER05 for now as I doubt anyone will get to it before the ER04 code freeze. I know what the problem is, just need to figure out how Solaris 10 wants the syntax to look. The problem is in "rhq-storage/bin/cassandra.in.sh", specifically in this if-statement: # set JVM javaagent opts to avoid warnings/errors if [ "$JVM_VENDOR" != "OpenJDK" -o "$JVM_VERSION" \> "1.6.0" ] \ || [ "$JVM_VERSION" = "1.6.0" -a "$JVM_PATCH_VERSION" -ge 23 ] That "\>" comparator isn't supported on Solaris 10. That is what is causing the error. It looks like on Fedora (and presumably everyone else BUT solaris), this statement is valid and does what it looks like it does: if [ "$JVM_VERSION" \> "1.6.0"] then echo JVM_VERSION is greater than 1.6.0 fi On my tests on Fedora, changing that env var to 1.5.9 results in false, whereas 1.7.0 results in true as expected. But on Solaris 10, that > operator doesn't work like that (note, if I take out the backslash, I don't get that error message on Solaris, but it doesn't work as expected either). The if-stmt in question is this: # set JVM javaagent opts to avoid warnings/errors if [ "$JVM_VENDOR" != "OpenJDK" -o "$JVM_VERSION" \> "1.6.0" ] \ || [ "$JVM_VERSION" = "1.6.0" -a "$JVM_PATCH_VERSION" -ge 23 ] then JAVA_AGENT="$JAVA_AGENT -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar" fi What this is saying is: IF JVM is NOT OpenJDK OR JVM version is higher than 1.6.0, then set -javaagent IF JVM version is exactly 1.6.0 but patch version is greater than 23 then set -javagent Essentially, what this basically means is "if java version is less than 1.6.0, don't set -javaagent" (ignore the OpenJDK thing for now). But because JON doesn't support JRE 1.5 or less, we don't have to worry about that. So I think this means we can take out that use of the > operator (which is what Solaris is barfing on). We can just say in that left side of the || operator: IF jvm vendor is NOT OpenJDK OR JVM version is NOT 1.6.0. Yes, this is true for 1.5.0 just as well as it is for 1.7.0, but we don't support 1.5.0 anyway - users won't be starting the storage nodes using that JRE 1.5.0 (or less). The actual script code could be, thus: # set JVM javaagent opts to avoid warnings/errors if [ "$JVM_VENDOR" != "OpenJDK" -o "$JVM_VERSION" != "1.6.0" ] \ || [ "$JVM_VERSION" = "1.6.0" -a "$JVM_PATCH_VERSION" -ge 23 ] then JAVA_AGENT="$JAVA_AGENT -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar" fi That removes the invalid > operator but retains the semantics we really need in reality. Again, this will allow for the then-clause to run if JRE is 1.5 or less, but that's moot because we just won't be running with that version anyway (other massive failures elsewhere will occur if users do that). to master: commit 096e1049c5f8b92322339e2de7a73bb750793af7 Author: John Mazzitelli <mazz> Date: Wed Oct 1 10:42:05 2014 -0400 BZ 1145683 - change if-stmt so it can work on solaris 10 cherry picked to release 3.3 branch: commit e29037cfe657f63c679a290409fa75b80eeeabcd Author: John Mazzitelli <mazz> Date: Wed Oct 1 10:42:05 2014 -0400 Moving to ON_QA as available to test with the latest brew build: https://brewweb.devel.redhat.com//buildinfo?buildID=394734 Verified on JON3.3 ER05. rhqctl install on Solaris 10 proceeds successfully. |