]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: init script waits until the radosgw stops 5831/head
authorDmitry Yatsushkevich <dyatsushkevich@mirantis.com>
Tue, 17 Mar 2015 22:44:52 +0000 (15:44 -0700)
committerLiam Young <liam.young@canonical.com>
Mon, 7 Sep 2015 10:42:32 +0000 (11:42 +0100)
Fixes: #11140
Init script waits in stop action until the radowgw daemons stop.

Signed-off-by: Dmitry Yatsushkevich <dyatsushkevich@mirantis.com>
(cherry picked from commit 1cca0c1e91a1e18f82f4d22855e96b2fc947f5ea)

src/init-radosgw
src/init-radosgw.sysv

index 914d6fddcc1a47a165e6d321a6b5314f74c85215..7af51efd51bf46a86b12b12621137a76bf942e3d 100644 (file)
@@ -87,7 +87,15 @@ case "$1" in
         $0 start
         ;;
     stop)
-        start-stop-daemon --stop -x $RADOSGW --oknodo
+        timeout=0
+        for name in `ceph-conf --list-sections $PREFIX`;
+        do
+          t=`$RADOSGW -n $name --show-config-value rgw_exit_timeout_secs`
+          if [ $t -gt $timeout ]; then timeout=$t; fi
+        done
+
+        if [ $timeout -gt 0 ]; then TIMEOUT="-R $timeout"; fi
+        start-stop-daemon --stop -x $RADOSGW --oknodo $TIMEOUT
         ;;
     status)
         daemon_is_running $RADOSGW
index 102e6409fc8e3f6d81a841be424271ff68cb20d7..1bb8a89d4c6418f542b9609ffcf5e3280a2d634a 100644 (file)
@@ -101,8 +101,19 @@ case "$1" in
         ;;
     stop)
         #start-stop-daemon --stop -x $RADOSGW --oknodo
+        timeout=0
+        for name in `ceph-conf --list-sections $PREFIX`;
+        do
+          t=`$RADOSGW -n $name --show-config-value rgw_exit_timeout_secs`
+          if [ $t -gt $timeout ]; then timeout=$t; fi
+        done
+
         killproc $RADOSGW
         echo "Stopping radosgw instance(s)..."
+        while pidof $RADOSGW >/dev/null && [ $timeout -gt 0 ] ; do
+          sleep 1
+          timeout=$(($timeout - 1))
+        done
         ;;
     status)
         daemon_is_running $RADOSGW