From: Dmitry Yatsushkevich Date: Tue, 17 Mar 2015 22:44:52 +0000 (-0700) Subject: rgw: init script waits until the radosgw stops X-Git-Tag: v0.80.11~32^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3be204f6a22be109d2aa8cfd5cee09ec3381d9b2;p=ceph.git rgw: init script waits until the radosgw stops Fixes: #11140 Init script waits in stop action until the radowgw daemons stop. Signed-off-by: Dmitry Yatsushkevich (cherry picked from commit 1cca0c1e91a1e18f82f4d22855e96b2fc947f5ea) --- diff --git a/src/init-radosgw b/src/init-radosgw index 914d6fddcc1a4..7af51efd51bf4 100644 --- a/src/init-radosgw +++ b/src/init-radosgw @@ -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 diff --git a/src/init-radosgw.sysv b/src/init-radosgw.sysv index 102e6409fc8e3..1bb8a89d4c641 100644 --- a/src/init-radosgw.sysv +++ b/src/init-radosgw.sysv @@ -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