|
@@ -32,20 +32,20 @@ fi
|
|
|
|
|
|
if [ "x$JMXDISABLE" = "x" ]
|
|
if [ "x$JMXDISABLE" = "x" ]
|
|
then
|
|
then
|
|
- echo "JMX enabled by default"
|
|
|
|
|
|
+ echo "JMX enabled by default" >&2
|
|
# for some reason these two options are necessary on jdk6 on Ubuntu
|
|
# for some reason these two options are necessary on jdk6 on Ubuntu
|
|
# accord to the docs they are not necessary, but otw jconsole cannot
|
|
# accord to the docs they are not necessary, but otw jconsole cannot
|
|
# do a local attach
|
|
# do a local attach
|
|
ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=$JMXLOCALONLY org.apache.zookeeper.server.quorum.QuorumPeerMain"
|
|
ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=$JMXLOCALONLY org.apache.zookeeper.server.quorum.QuorumPeerMain"
|
|
else
|
|
else
|
|
- echo "JMX disabled by user request"
|
|
|
|
|
|
+ echo "JMX disabled by user request" >&2
|
|
ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
|
|
ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
|
|
fi
|
|
fi
|
|
|
|
|
|
# Only follow symlinks if readlink supports it
|
|
# Only follow symlinks if readlink supports it
|
|
-if readlink -f "$0" > /dev/null 2>&1
|
|
|
|
|
|
+if readlink "$0" > /dev/null 2>&1
|
|
then
|
|
then
|
|
- ZOOBIN=`readlink -f "$0"`
|
|
|
|
|
|
+ ZOOBIN=`readlink "$0"`
|
|
else
|
|
else
|
|
ZOOBIN="$0"
|
|
ZOOBIN="$0"
|
|
fi
|
|
fi
|
|
@@ -58,6 +58,12 @@ then
|
|
ZOOCFG="$ZOOCFGDIR/$2"
|
|
ZOOCFG="$ZOOCFGDIR/$2"
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+# if we give a more complicated path to the config, don't screw around in $ZOOCFGDIR
|
|
|
|
+if [ "x`dirname $ZOOCFG`" != "x$ZOOCFGDIR" ]
|
|
|
|
+then
|
|
|
|
+ ZOOCFG="$2"
|
|
|
|
+fi
|
|
|
|
+
|
|
if $cygwin
|
|
if $cygwin
|
|
then
|
|
then
|
|
ZOOCFG=`cygpath -wp "$ZOOCFG"`
|
|
ZOOCFG=`cygpath -wp "$ZOOCFG"`
|
|
@@ -67,7 +73,7 @@ else
|
|
KILL=kill
|
|
KILL=kill
|
|
fi
|
|
fi
|
|
|
|
|
|
-echo "Using config: $ZOOCFG"
|
|
|
|
|
|
+echo "Using config: $ZOOCFG" >&2
|
|
|
|
|
|
if [ -z $ZOOPIDFILE ]
|
|
if [ -z $ZOOPIDFILE ]
|
|
then ZOOPIDFILE=$(grep dataDir "$ZOOCFG" | sed -e 's/.*=//')/zookeeper_server.pid
|
|
then ZOOPIDFILE=$(grep dataDir "$ZOOCFG" | sed -e 's/.*=//')/zookeeper_server.pid
|
|
@@ -82,6 +88,13 @@ start)
|
|
/bin/echo -n $! > "$ZOOPIDFILE"
|
|
/bin/echo -n $! > "$ZOOPIDFILE"
|
|
echo STARTED
|
|
echo STARTED
|
|
;;
|
|
;;
|
|
|
|
+start-foreground)
|
|
|
|
+ java "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
|
|
|
|
+ -cp "$CLASSPATH" $JVMFLAGS $ZOOMAIN "$ZOOCFG"
|
|
|
|
+ ;;
|
|
|
|
+print-cmd)
|
|
|
|
+ echo "java -Dzookeeper.log.dir=\"${ZOO_LOG_DIR}\" -Dzookeeper.root.logger=\"${ZOO_LOG4J_PROP}\" -cp \"$CLASSPATH\" $JVMFLAGS $ZOOMAIN \"$ZOOCFG\""
|
|
|
|
+ ;;
|
|
stop)
|
|
stop)
|
|
echo "Stopping zookeeper ... "
|
|
echo "Stopping zookeeper ... "
|
|
if [ ! -f "$ZOOPIDFILE" ]
|
|
if [ ! -f "$ZOOPIDFILE" ]
|