Allow stop/kill to continue in the event that it cannot stop or kill one of the old containers.

Also actually attempt to kill if stop has a bad exit code.
This commit is contained in:
Trevor Joynson (trevorj)
2015-07-30 16:00:53 -04:00
parent b0d55ce589
commit c750f5a768

8
dokku
View File

@@ -178,8 +178,12 @@ case "$1" in
trap '' INT HUP
sleep $WAIT
for oldid in $oldids; do
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
# Attempt to stop, if that fails, then force a kill as docker seems
# to not send SIGKILL as the docs would indicate. If that fails, move
# on to the next.
docker stop $oldid \
|| docker kill $oldid \
|| : # Always continue in case we have multiple to kill
done
) & disown -a
# Use trap since disown/nohup don't seem to keep child alive