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
This commit is contained in:
Matthias Radestock committed 2014-09-30 17:31:47 +01:00
1 parent 9b14f0b507
commit e7e7de2173
1 file changed
+1 -1
+1 -1
View File
@@ -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