don't rely on docker inspect for determining container death

Docker can take a while to notice & record the death of containers, so
we perform a more direct check instead.

Fixes #522.
This commit is contained in:
Matthias Radestock committed 2015-04-11 12:24:09 +01:00
1 parent f433d26d1f
commit 59ae50eb4e
1 file changed
+1 -1
+1 -1
View File
@@ -284,7 +284,7 @@ with_container_netns () {
shift 1
if ! "$@" >$IP_TMPOUT 2>$IP_TMPERR ; then
STATUS=1
if [ "$(docker inspect --format='{{.State.Pid}}' $CONTAINER)" != "$CONTAINER_PID" ] ; then
if ! kill -0 "$CONTAINER_PID" 2>/dev/null ; then
echo "Container $CONTAINER died" >&2
else
echo "Failure during network configuration for container $CONTAINER:" >&2