You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ma...@apache.org on 2012/12/17 07:10:36 UTC

svn commit: r1422758 - in /zookeeper/trunk: CHANGES.txt bin/zkEnv.sh bin/zkServer.sh

Author: mahadev
Date: Mon Dec 17 06:10:35 2012
New Revision: 1422758

URL: http://svn.apache.org/viewvc?rev=1422758&view=rev
Log:
ZOOKEEPER-1335. Add support for --config to zkEnv.sh to specify a config directory different than what is expected (Arpit Gupta via mahadev)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/bin/zkEnv.sh
    zookeeper/trunk/bin/zkServer.sh

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1422758&r1=1422757&r2=1422758&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Mon Dec 17 06:10:35 2012
@@ -440,6 +440,9 @@ IMPROVEMENTS:
   ZOOKEEPER-1602. a change to QuorumPeerConfig's API broke
   compatibility with HBase (Alexander Shraer via phunt)
 
+  ZOOKEEPER-1335. Add support for --config to zkEnv.sh to specify a config
+  directory different than what is expected (Arpit Gupta via mahadev)
+
 Release 3.4.0 - 
 
 Non-backward compatible changes:

Modified: zookeeper/trunk/bin/zkEnv.sh
URL: http://svn.apache.org/viewvc/zookeeper/trunk/bin/zkEnv.sh?rev=1422758&r1=1422757&r2=1422758&view=diff
==============================================================================
--- zookeeper/trunk/bin/zkEnv.sh (original)
+++ zookeeper/trunk/bin/zkEnv.sh Mon Dec 17 06:10:35 2012
@@ -21,11 +21,25 @@
 # We use ZOOCFGDIR if defined,
 # otherwise we use /etc/zookeeper
 # or the conf directory that is
-# a sibling of this script's directory
+# a sibling of this script's directory.
+# Or you can specify the ZOOCFGDIR using the
+# '--config' option in the command line.
 
 ZOOBINDIR=${ZOOBINDIR:-/usr/bin}
 ZOOKEEPER_PREFIX=${ZOOBINDIR}/..
 
+#check to see if the conf dir is given as an optional argument
+if [ $# -gt 1 ]
+then
+    if [ "--config" = "$1" ]
+	  then
+	      shift
+	      confdir=$1
+	      shift
+	      ZOOCFGDIR=$confdir
+    fi
+fi
+
 if [ "x$ZOOCFGDIR" = "x" ]
 then
   if [ -e "${ZOOKEEPER_PREFIX}/conf" ]; then

Modified: zookeeper/trunk/bin/zkServer.sh
URL: http://svn.apache.org/viewvc/zookeeper/trunk/bin/zkServer.sh?rev=1422758&r1=1422757&r2=1422758&view=diff
==============================================================================
--- zookeeper/trunk/bin/zkServer.sh (original)
+++ zookeeper/trunk/bin/zkServer.sh Mon Dec 17 06:10:35 2012
@@ -187,6 +187,6 @@ status)
     fi
     ;;
 *)
-    echo "Usage: $0 {start|start-foreground|stop|restart|status|upgrade|print-cmd}" >&2
+    echo "Usage: $0 [--config <conf-dir>] {start|start-foreground|stop|restart|status|upgrade|print-cmd}" >&2
 
 esac