Browse Source

ZOOKEEPER-2173. ZK startup failure should be handled with proper error message (J.Andreina via camille)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1676359 13f79535-47bb-0310-9956-ffa450edef68
Camille Fournier 10 năm trước cách đây
mục cha
commit
a3b80499f9
2 tập tin đã thay đổi với 10 bổ sung1 xóa
  1. 3 0
      CHANGES.txt
  2. 7 1
      bin/zkServer.sh

+ 3 - 0
CHANGES.txt

@@ -78,6 +78,9 @@ BUGFIXES:
 
   ZOOKEEPER-1626 Zookeeper C client should be tolerant of clock adjustments
   (Colin Patrick McCabe via michim)
+  
+  ZOOKEEPER-2173. ZK startup failure should be handled with proper error message
+  (J.Andreina via camille)
 
 IMPROVEMENTS:
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)  

+ 7 - 1
bin/zkServer.sh

@@ -153,7 +153,13 @@ start)
       if /bin/echo -n $! > "$ZOOPIDFILE"
       then
         sleep 1
-        echo STARTED
+        pid=$(cat "${ZOOPIDFILE}")
+        if ps -p "${pid}" > /dev/null 2>&1; then
+          echo STARTED
+        else
+          echo FAILED TO START
+          exit 1
+        fi
       else
         echo FAILED TO WRITE PID
         exit 1