Commits

Anonymous committed da9509b
  • Participants
  • Parent commits 1fe0f31
  • Branches cassandra-0.8.3

Comments (0)

Files changed (4)

File bin/cassandra

 fi
 
 # Use JAVA_HOME if set, otherwise look for java in PATH
-if [ -n "$JAVA_HOME" ]; then
+if [ -x $JAVA_HOME/bin/java ]; then
     JAVA="$JAVA_HOME/bin/java"
 else
-    JAVA=java
+    JAVA=`which java`
 fi
 
 if [ -z "$CASSANDRA_CONF" -o -z "$CLASSPATH" ]; then

File conf/cassandra-env.sh

 JVM_OPTS="$JVM_OPTS -ea"
 
 # add the jamm javaagent
-check_openjdk=`"${JAVA:-java}" -version 2>&1 | awk '{if (NR == 2) {print $1}}'`
+check_openjdk=$(java -version 2>&1 | awk '{if (NR == 2) {print $1}}')
 if [ "$check_openjdk" != "OpenJDK" ]
 then
     JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/lib/jamm-0.2.2.jar"

File debian/cassandra.postinst

                 cassandra
         fi
 
-        if [ -n "$2" ] && dpkg --compare-versions "$2" le 0.6.4-2; then
+        if [ -n $2 ] && dpkg --compare-versions "$2" le 0.6.4-2; then
             chown -R cassandra: /var/lib/cassandra
             chown -R cassandra: /var/log/cassandra
         fi
 [ -e /etc/cassandra/cassandra.yaml ] || exit 0
 [ -e /etc/cassandra/cassandra-env.sh ] || exit 0
 
+# Read Cassandra environment file.
+. /etc/cassandra/cassandra-env.sh
+
 # Read configuration variable file if it is present
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
+if [ -z "$JVM_OPTS" ]; then
+    echo "Initialization failed; \$JVM_OPTS not set!" >&2
+    exit 3
+fi
+
 # If JAVA_HOME has not been set, try to determine it.
 if [ -z "$JAVA_HOME" ]; then
     # If java is in PATH, use a JAVA_HOME that corresponds to that. This is
     # both consistent with how the upstream startup script works, and how
     # Debian works (read: the use of alternatives to set a system JVM).
-    if [ -n "`which java`" ]; then
+    if [ -n `which java` ]; then
         java=`which java`
         # Dereference symlink(s)
         while true; do
         done
     fi
 fi
-JAVA="$JAVA_HOME/bin/java"
-
-# Read Cassandra environment file.
-. /etc/cassandra/cassandra-env.sh
-
-if [ -z "$JVM_OPTS" ]; then
-    echo "Initialization failed; \$JVM_OPTS not set!" >&2
-    exit 3
-fi
 
 # Load the VERBOSE setting and other rcS variables
 . /lib/init/vars.sh