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)
$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
;;
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