From e7e7de2173650fee5664190d7ce7b8b086d1e4ac Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Tue, 30 Sep 2014 17:31:47 +0100 Subject: [PATCH] check whether a container has died with docker rather than ps since that means one less dependency on running 'weave' in the same namespace as docker --- weaver/weave | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weaver/weave b/weaver/weave index 26423cb2..2348b00e 100755 --- a/weaver/weave +++ b/weaver/weave @@ -142,7 +142,7 @@ with_container_netns () { STATUS=0 if ! "$@" >$IP_TMPFILE 2>&1 ; then STATUS=1 - if ! ps -p $CONTAINER_PID >/dev/null 2>&1 ; then + if [ "$(docker inspect --format='{{ .State.Pid }}' $CONTAINER)" != "$CONTAINER_PID" ] ; then echo "Container $CONTAINER died" >&2 else echo "Failure during network configuration for container $CONTAINER:" >&2