]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: init script waits until the radosgw stops 4056/head
authorDmitry Yatsushkevich <dyatsushkevich@mirantis.com>
Tue, 17 Mar 2015 22:44:52 +0000 (15:44 -0700)
committerDmitry Yatsushkevich <dyatsushkevich@mirantis.com>
Mon, 23 Mar 2015 19:40:23 +0000 (12:40 -0700)
Fixes: #11140
Init script waits in stop action until the radowgw daemons stop.

Signed-off-by: Dmitry Yatsushkevich <dyatsushkevich@mirantis.com>
src/init-radosgw
src/init-radosgw.sysv

index 1ef71c43d6a2f428585b57febe733ecfa987b174..8c4b6b8545f2cfcd294bda6a1daa99f3f233c83e 100644 (file)
@@ -93,7 +93,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 e210b79144ea475ca2aa815c95ec73191433bf03..91d994d72388a907cc1be4cded722386330e3046 100644 (file)
@@ -107,8 +107,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