From e5cca0d2d75f4bf4c94d93093a5adfbe0ec4da7e Mon Sep 17 00:00:00 2001 From: Lewis Marshall Date: Tue, 31 Mar 2015 01:33:27 +0100 Subject: [PATCH] Prevent Upstart post-start stanza from hanging Once the job has failed and is respawned, the status becomes `docker respawn/post-start` after subsequent failures (as opposed to `docker stop/post-start`), so the post-start script needs to take this into account. I could not find specific documentation on the job transitioning to the `respawn/post-start` state, but this was observed on Ubuntu 14.04.2. Signed-off-by: Lewis Marshall Upstream-commit: 302e3834a0bfa860f9d06b42a2955b0cbd135c38 Component: engine --- components/engine/contrib/init/upstart/docker.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/engine/contrib/init/upstart/docker.conf b/components/engine/contrib/init/upstart/docker.conf index f9930bd396..4ad6058ed0 100644 --- a/components/engine/contrib/init/upstart/docker.conf +++ b/components/engine/contrib/init/upstart/docker.conf @@ -49,7 +49,7 @@ post-start script fi if ! printf "%s" "$DOCKER_OPTS" | grep -qE -e '-H|--host'; then while ! [ -e /var/run/docker.sock ]; do - initctl status $UPSTART_JOB | grep -q "stop/" && exit 1 + initctl status $UPSTART_JOB | grep -qE "(stop|respawn)/" && exit 1 echo "Waiting for /var/run/docker.sock" sleep 0.1 done