accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [02/12] git commit: ACCUMULO-1873 Better ZOOKEEPER_HOME check in start-all.sh
Date Tue, 19 Nov 2013 17:58:58 GMT
ACCUMULO-1873 Better ZOOKEEPER_HOME check in start-all.sh

The script now checks that ZOOKEEPER_HOME is a directory and detects
when the search for a ZK JAR comes up empty.

Signed-off-by: Eric Newton <eric.newton@gmail.com>


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

Branch: refs/heads/1.5.1-SNAPSHOT
Commit: 0927eb83067ad2f209f67ab25a7c5b9009b18000
Parents: ada4180
Author: Bill Havanki <bhavanki@cloudera.com>
Authored: Fri Nov 15 10:35:04 2013 -0500
Committer: Eric Newton <eric.newton@gmail.com>
Committed: Tue Nov 19 12:44:04 2013 -0500

----------------------------------------------------------------------
 bin/start-all.sh | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0927eb83/bin/start-all.sh
----------------------------------------------------------------------
diff --git a/bin/start-all.sh b/bin/start-all.sh
index 278e7b9..4e45e4c 100755
--- a/bin/start-all.sh
+++ b/bin/start-all.sh
@@ -33,10 +33,20 @@ if [ -z $ZOOKEEPER_HOME ] ; then
     echo "ZOOKEEPER_HOME is not set.  Please make sure it's set globally or in conf/accumulo-env.sh"
     exit 1
 fi
+if [ ! -d $ZOOKEEPER_HOME ]; then
+   echo "ZOOKEEPER_HOME is not a directory: $ZOOKEEPER_HOME"
+   echo "Please check the setting, either globally or in accumulo-env.sh."
+   exit 1
+fi
 
-ZOOKEEPER_VERSION=`(cd $ZOOKEEPER_HOME; ls zookeeper-[0-9]*.jar | head -1)`
-ZOOKEEPER_VERSION=${ZOOKEEPER_VERSION/zookeeper-/}
-ZOOKEEPER_VERSION=${ZOOKEEPER_VERSION/.jar/}
+ZOOKEEPER_VERSION=$(find $ZOOKEEPER_HOME -maxdepth 1 -name "zookeeper-[0-9]*.jar" | head
-1)
+if [ -z "$ZOOKEEPER_VERSION" ]; then
+   echo "A Zookeeper JAR was not found in $ZOOKEEPER_HOME."
+   echo "Please check ZOOKEEPER_HOME, either globally or in accumulo-env.sh."
+   exit 1
+fi
+ZOOKEEPER_VERSION=${ZOOKEEPER_VERSION##$ZOOKEEPER_HOME/zookeeper-}
+ZOOKEEPER_VERSION=${ZOOKEEPER_VERSION%%.jar}
 
 if [ "$ZOOKEEPER_VERSION" '<' "3.3.0" ] ; then 
 	echo "WARN : Using Zookeeper $ZOOKEEPER_VERSION.  Use version 3.3.0 or greater to avoid
zookeeper deadlock bug.";


Mime
View raw message