Browse Source

Use the name of the first unix socket in DOCKER_OPTS

Otherwise the while loop waits forever, checking for
a filename made up of all the names.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Bryan Boreham 9 years ago
parent
commit
68dab9bd09
1 changed files with 1 additions and 1 deletions
  1. 1 1
      contrib/init/upstart/docker.conf

+ 1 - 1
contrib/init/upstart/docker.conf

@@ -58,7 +58,7 @@ post-start script
 	if ! printf "%s" "$DOCKER_OPTS" | grep -qE -e '-H|--host'; then
 	if ! printf "%s" "$DOCKER_OPTS" | grep -qE -e '-H|--host'; then
 		DOCKER_SOCKET=/var/run/docker.sock
 		DOCKER_SOCKET=/var/run/docker.sock
 	else
 	else
-		DOCKER_SOCKET=$(printf "%s" "$DOCKER_OPTS" | grep -oP -e '(-H|--host)\W*unix://\K(\S+)')
+		DOCKER_SOCKET=$(printf "%s" "$DOCKER_OPTS" | grep -oP -e '(-H|--host)\W*unix://\K(\S+)' | sed 1q)
 	fi
 	fi
 
 
 	if [ -n "$DOCKER_SOCKET" ]; then
 	if [ -n "$DOCKER_SOCKET" ]; then