summaryrefslogtreecommitdiff
path: root/bin/zkServer.sh
diff options
context:
space:
mode:
authorPatrick D. Hunt <phunt@apache.org>2011-12-28 06:07:19 +0000
committerPatrick D. Hunt <phunt@apache.org>2011-12-28 06:07:19 +0000
commit00a6861f922b55cbfeec3eb928be2b57ddf99780 (patch)
tree9fae15cbc7334d7300ebde8599d3f89db419a340 /bin/zkServer.sh
parentaa4674cefe019a4cff7e874472b6aa12fa842888 (diff)
downloadzookeeper-00a6861f922b55cbfeec3eb928be2b57ddf99780.tar.gz
ZOOKEEPER-1089. zkServer.sh status does not work due to invalid option of nc (Roman Shaposhnik via phunt)
git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1225108 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'bin/zkServer.sh')
-rwxr-xr-xbin/zkServer.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/zkServer.sh b/bin/zkServer.sh
index 55042d632..224a92f49 100755
--- a/bin/zkServer.sh
+++ b/bin/zkServer.sh
@@ -146,7 +146,10 @@ restart)
;;
status)
# -q is necessary on some versions of linux where nc returns too quickly, and no stat result is output
- STAT=`echo stat | nc -q 1 localhost $(grep "^[[:space:]]*clientPort" "$ZOOCFG" | sed -e 's/.*=//') 2> /dev/null| grep Mode`
+ STAT=`$JAVA "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
+ -cp "$CLASSPATH" $JVMFLAGS org.apache.zookeeper.client.FourLetterWordMain localhost \
+ $(grep "^[[:space:]]*clientPort" "$ZOOCFG" | sed -e 's/.*=//') srvr 2> /dev/null \
+ | grep Mode`
if [ "x$STAT" = "x" ]
then
echo "Error contacting service. It is probably not running."