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: v9.0.0~110^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4056%2Fhead;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 --- diff --git a/src/init-radosgw b/src/init-radosgw index 1ef71c43d6a2..8c4b6b8545f2 100644 --- a/src/init-radosgw +++ b/src/init-radosgw @@ -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 diff --git a/src/init-radosgw.sysv b/src/init-radosgw.sysv index e210b79144ea..91d994d72388 100644 --- a/src/init-radosgw.sysv +++ b/src/init-radosgw.sysv @@ -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