output containers to be stopped and killed. attempt a kill on old containers after we attempt to stop them
This commit is contained in:
1 parent
290745d324
commit
673d43b532
1 file changed
+6
-2
@@ -145,13 +145,17 @@ case "$1" in
|
|||||||
if [[ -n "$oldids" ]]; then
|
if [[ -n "$oldids" ]]; then
|
||||||
# Let the old container finish processing requests, before terminating it
|
# Let the old container finish processing requests, before terminating it
|
||||||
WAIT="${DOKKU_WAIT_TO_RETIRE:-60}"
|
WAIT="${DOKKU_WAIT_TO_RETIRE:-60}"
|
||||||
dokku_log_info1 "Shutting down old container in $WAIT seconds"
|
dokku_log_info1 "Shutting down old containers in $WAIT seconds"
|
||||||
|
for oldid in $oldids; do
|
||||||
|
dokku_log_info2 "$oldid"
|
||||||
|
done
|
||||||
(
|
(
|
||||||
exec >/dev/null 2>/dev/null </dev/null
|
exec >/dev/null 2>/dev/null </dev/null
|
||||||
trap '' INT HUP
|
trap '' INT HUP
|
||||||
sleep $WAIT
|
sleep $WAIT
|
||||||
for oldid in $oldids; do
|
for oldid in $oldids; do
|
||||||
docker stop $oldid
|
docker stop $oldid &> /dev/null
|
||||||
|
docker kill $oldid &> /dev/null # force a kill as docker seems to not send SIGKILL as the docs would indicate
|
||||||
done
|
done
|
||||||
) & disown -a
|
) & disown -a
|
||||||
# Use trap since disown/nohup don't seem to keep child alive
|
# Use trap since disown/nohup don't seem to keep child alive
|
||||||
|
|||||||
Reference in new issue
Block a user