You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2013/06/18 16:32:55 UTC

[36/41] git commit: updated refs/heads/1832-fix-empty-attachment-name to ad774b6

Fix for COUCHDB-1449 stopped status returned before couchdb process exits.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/4bd0adce
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/4bd0adce
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/4bd0adce

Branch: refs/heads/1832-fix-empty-attachment-name
Commit: 4bd0adce93ce0d5c45463d87cb186541d11f11f3
Parents: 5cd29f4
Author: Wendall Cada <we...@83864.com>
Authored: Mon Mar 11 12:05:34 2013 -0700
Committer: Wendall Cada <we...@apache.org>
Committed: Thu Mar 21 15:19:35 2013 -0700

----------------------------------------------------------------------
 bin/couchdb.tpl.in | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/4bd0adce/bin/couchdb.tpl.in
----------------------------------------------------------------------
diff --git a/bin/couchdb.tpl.in b/bin/couchdb.tpl.in
index eab27b5..31bc7d9 100644
--- a/bin/couchdb.tpl.in
+++ b/bin/couchdb.tpl.in
@@ -267,12 +267,20 @@ EOF
 
 stop_couchdb () {
     PID=`_get_pid`
+    STOP_TIMEOUT=60
     if test -n "$PID"; then
-        if test "$1" = "false"; then
-            echo > $PID_FILE
-        fi
         if kill -0 $PID 2> /dev/null; then
-            if kill -1 $PID 2> /dev/null; then
+            if kill -TERM $PID 2> /dev/null; then
+                count=0
+                while kill -0 $PID 2> /dev/null; do
+                    if [ $count -ge $STOP_TIMEOUT ]; then
+                        echo "Apache CouchDB failed to shutdown."
+                        return $SCRIPT_ERROR
+                    else
+                        count=$[count+1]
+                        sleep 1
+                    fi
+                done
                 if test "$1" = "false"; then
                     echo "Apache CouchDB has been shutdown."
                 else