cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject git commit: do not ignore user configured JAVA_HOME
Date Thu, 02 Jan 2014 23:12:21 GMT
Updated Branches:
  refs/heads/cassandra-2.0 5284e129f -> d278b7c2d


do not ignore user configured JAVA_HOME

Patch by eevans; reviewed by Michael Shuler for CASSANDRA-6131


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d278b7c2
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d278b7c2
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d278b7c2

Branch: refs/heads/cassandra-2.0
Commit: d278b7c2d5f4bc74b8c621b6b18503fc7d08422d
Parents: 5284e12
Author: Eric Evans <eevans@apache.org>
Authored: Thu Jan 2 17:05:43 2014 -0600
Committer: Eric Evans <eevans@apache.org>
Committed: Thu Jan 2 17:05:43 2014 -0600

----------------------------------------------------------------------
 debian/init | 43 +++++++------------------------------------
 1 file changed, 7 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d278b7c2/debian/init
----------------------------------------------------------------------
diff --git a/debian/init b/debian/init
index 26faeba..d132441 100644
--- a/debian/init
+++ b/debian/init
@@ -24,9 +24,6 @@ WAIT_FOR_START=10
 CASSANDRA_HOME=/usr/share/cassandra
 FD_LIMIT=100000
 
-# The first existing directory is used for JAVA_HOME if needed.
-JVM_SEARCH_DIRS="/usr/lib/jvm/default-java"
-
 [ -e /usr/share/cassandra/apache-cassandra.jar ] || exit 0
 [ -e /etc/cassandra/cassandra.yaml ] || exit 0
 [ -e /etc/cassandra/cassandra-env.sh ] || exit 0
@@ -34,34 +31,6 @@ JVM_SEARCH_DIRS="/usr/lib/jvm/default-java"
 # Read configuration variable file if it is present
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
-# 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
-        java=`which java`
-        # Dereference symlink(s)
-        while true; do
-            if [ -h "$java" ]; then
-                java=`readlink "$java"`
-                continue
-            fi
-            break
-        done
-        JAVA_HOME="`dirname $java`/../"
-    # No JAVA_HOME set and no java found in PATH, search for a JVM.
-    else
-        for jdir in $JVM_SEARCH_DIRS; do
-            if [ -x "$jdir/bin/java" ]; then
-                JAVA_HOME="$jdir"
-                break
-            fi
-        done
-    fi
-fi
-JAVA="$JAVA_HOME/bin/java"
-
 # Read Cassandra environment file.
 . /etc/cassandra/cassandra-env.sh
 
@@ -70,6 +39,12 @@ if [ -z "$JVM_OPTS" ]; then
     exit 3
 fi
 
+# Add JNA to EXTRA_CLASSPATH
+export EXTRA_CLASSPATH="/usr/share/java/jna.jar:$EXTRA_CLASSPATH"
+
+# Export JAVA_HOME, if set.
+[ -n "$JAVA_HOME" ] && export JAVA_HOME
+
 # Load the VERBOSE setting and other rcS variables
 . /lib/init/vars.sh
 
@@ -77,10 +52,6 @@ fi
 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
 . /lib/lsb/init-functions
 
-# If JNA is installed, add it to EXTRA_CLASSPATH
-#
-EXTRA_CLASSPATH="/usr/share/java/jna.jar:$EXTRA_CLASSPATH"
-
 #
 # Function that returns 0 if process is running, or nonzero if not.
 #
@@ -119,7 +90,7 @@ do_start()
     [ -e `dirname "$PIDFILE"` ] || \
         install -d -ocassandra -gcassandra -m750 `dirname $PIDFILE`
 
-    export EXTRA_CLASSPATH
+
 
     start-stop-daemon -S -c cassandra -a /usr/sbin/cassandra -q -p "$PIDFILE" -t >/dev/null
|| return 1
 


Mime
View raw message