zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject svn commit: r1548026 - in /zookeeper/bookkeeper/branches/branch-4.2: CHANGES.txt bookkeeper-server/bin/bookkeeper
Date Thu, 05 Dec 2013 06:43:36 GMT
Author: sijie
Date: Thu Dec  5 06:43:36 2013
New Revision: 1548026

URL: http://svn.apache.org/r1548026
Log:
BOOKKEEPER-712: bookkeeper script should use java from JAVA_HOME (vinay via sijie)

Modified:
    zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt
    zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/bin/bookkeeper

Modified: zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt?rev=1548026&r1=1548025&r2=1548026&view=diff
==============================================================================
--- zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt (original)
+++ zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt Thu Dec  5 06:43:36 2013
@@ -8,6 +8,8 @@ Release 4.2.3 - 2013-12-04
 
         BOOKKEEPER-711: bookkeeper-daemon.sh will not remove the pid file one successful
stop (vinay via sijie)
 
+        BOOKKEEPER-712: bookkeeper script should use 'java' from JAVA_HOME (vinay via sijie)
+
 Release 4.2.2 - 2013-10-02
 
   Backward compatible changes:

Modified: zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/bin/bookkeeper
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/bin/bookkeeper?rev=1548026&r1=1548025&r2=1548026&view=diff
==============================================================================
--- zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/bin/bookkeeper (original)
+++ zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/bin/bookkeeper Thu Dec  5 06:43:36
2013
@@ -20,6 +20,13 @@
 # * limitations under the License.
 # */
 
+# Check for the Java
+if [[ -z $JAVA_HOME ]]; then
+   echo "Error: JAVA_HOME is not set" 1>&2
+   exit 1
+fi
+JAVA=$JAVA_HOME/bin/java
+
 # check if net.ipv6.bindv6only is set to 1
 bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
 if [ -n "$bindv6only" ] && [ "$bindv6only" -eq "1" ]
@@ -168,21 +175,21 @@ OPTS="$OPTS -Dbookkeeper.log.file=$BOOKI
 #Change to BK_HOME to support relative paths
 cd "$BK_HOME"
 if [ $COMMAND == "bookie" ]; then
-    exec java $OPTS $JMX_ARGS org.apache.bookkeeper.proto.BookieServer --conf $BOOKIE_CONF
$@
+    exec $JAVA $OPTS $JMX_ARGS org.apache.bookkeeper.proto.BookieServer --conf $BOOKIE_CONF
$@
 elif [ $COMMAND == "autorecovery" ]; then
-    exec java $OPTS $JMX_ARGS org.apache.bookkeeper.replication.AutoRecoveryMain --conf $BOOKIE_CONF
$@
+    exec $JAVA $OPTS $JMX_ARGS org.apache.bookkeeper.replication.AutoRecoveryMain --conf
$BOOKIE_CONF $@
 elif [ $COMMAND == "localbookie" ]; then
     NUMBER=$1
     shift
-    exec java $OPTS $JMX_ARGS org.apache.bookkeeper.util.LocalBookKeeper $NUMBER $BOOKIE_CONF
$@
+    exec $JAVA $OPTS $JMX_ARGS org.apache.bookkeeper.util.LocalBookKeeper $NUMBER $BOOKIE_CONF
$@
 elif [ $COMMAND == "upgrade" ]; then
-    exec java $OPTS org.apache.bookkeeper.bookie.FileSystemUpgrade --conf $BOOKIE_CONF $@
+    exec $JAVA $OPTS org.apache.bookkeeper.bookie.FileSystemUpgrade --conf $BOOKIE_CONF $@
 elif [ $COMMAND == "shell" ]; then
     ENTRY_FORMATTER_ARG="-DentryFormatterClass=${ENTRY_FORMATTER_CLASS:-org.apache.bookkeeper.util.StringEntryFormatter}"
-    exec java $OPTS $ENTRY_FORMATTER_ARG org.apache.bookkeeper.bookie.BookieShell -conf $BOOKIE_CONF
$@
+    exec $JAVA $OPTS $ENTRY_FORMATTER_ARG org.apache.bookkeeper.bookie.BookieShell -conf
$BOOKIE_CONF $@
 elif [ $COMMAND == "help" ]; then
     bookkeeper_help;
 else
-    exec java $OPTS $COMMAND $@
+    exec $JAVA $OPTS $COMMAND $@
 fi
 



Mime
View raw message