Description of problem: Tried ./rhqctl install using Bourne Shell on Solaris 10: the console displays a message "./cassandra: test: unknown operator >" and it does not proceed after installing the storage node: -------- 15:06:28,920 INFO [org.rhq.server.control.command.Install] The storage node installer has finished with an exit value of 0 ./cassandra: test: unknown operator > 15:06:28,937 INFO [org.rhq.server.control.command.Install] Pausing to ensure RHQ Storage is initialized prior to RHQ Server installation. # ----------- Trying to install rhq server which results into the same message: # ./rhqctl install --server ------------------- WARNING: The readlink command is not available on this platform. If this script was launched from a symbolic link, errors may occur. Consider installing readlink on this platform. 16:50:28,104 INFO [org.jboss.modules] JBoss Modules version 1.3.3.Final-redhat-1 ./cassandra: test: unknown operator > 16:50:28,798 INFO [org.rhq.server.control.command.Install] Pausing to ensure RHQ Storage is initialized prior to RHQ Server installation. # ------------ Environment details: # uname -sr SunOS 5.10 # echo $SHELL /sbin/sh Version-Release number of selected component (if applicable): JON 3.3 ER03 How reproducible: Always Steps to Reproduce: 1. On Solaris 10, try ./rhqctl install 2. Console display a message ./cassandra: test: unknown operator > and installation does not proceed. Actual results: Installation does not work on solaris 10 displaying ./cassandra: test: unknown operator > Expected results: Installation succeeds. Additional info:
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.