[Groonga-commit] groonga/groonga at 884773e [master] groonga-httpd-restart: fix inverted condition

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Aug 22 18:18:49 JST 2013


Kouhei Sutou	2013-08-22 18:18:49 +0900 (Thu, 22 Aug 2013)

  New Revision: 884773eeaef02045d6f74baf320dbff648e3feb3
  https://github.com/groonga/groonga/commit/884773eeaef02045d6f74baf320dbff648e3feb3

  Message:
    groonga-httpd-restart: fix inverted condition

  Modified files:
    data/scripts/groonga-httpd-restart

  Modified: data/scripts/groonga-httpd-restart (+11 -1)
===================================================================
--- data/scripts/groonga-httpd-restart    2013-08-22 18:18:20 +0900 (ff19228)
+++ data/scripts/groonga-httpd-restart    2013-08-22 18:18:49 +0900 (5ce1a88)
@@ -40,6 +40,16 @@ wait_until () {
     return 1
 }
 
+wait_while () {
+    for n in $(seq ${TIMEOUT}); do
+        if ! "$@"; then
+            return 0
+        fi
+        sleep 1
+    done
+    return 1
+}
+
 start_master () {
     local pid=$1
     kill -USR2 ${pid}
@@ -78,7 +88,7 @@ NEW_PID=$(cat ${PID_FILE})
 OLD_WORKER_PROCESSES=$(pgrep -P ${OLD_PID} | grep -v ${NEW_PID})
 switch_worker ${OLD_PID}
 for pid in ${OLD_WORKER_PROCESSES}; do
-    wait_until ps --pid=${pid} > /dev/null
+    wait_while ps --pid=${pid} > /dev/null
 done
 OLD_WORKER_PROCESSES=$(pgrep -P ${OLD_PID} | grep -v ${NEW_PID})
 if [ -n "${OLD_WORKER_PROCESSES}" ]; then
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index