From a598dba1346c9f2e878e8250a9d641a2206cb4e5 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 16 May 2014 09:08:59 -0400 Subject: [PATCH] Wait for pidfile to exist when starting with Redhat init script Fixes #5359 Docker-DCO-1.1-Signed-off-by: Chris St. Pierre (github: stpierre) --- contrib/init/sysvinit-redhat/docker | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/init/sysvinit-redhat/docker b/contrib/init/sysvinit-redhat/docker index 2b75c6903f..7d056aacad 100755 --- a/contrib/init/sysvinit-redhat/docker +++ b/contrib/init/sysvinit-redhat/docker @@ -49,6 +49,11 @@ start() { $exec -d $other_args &>> $logfile & pid=$! touch $lockfile + # wait for the pidfile to exist. see + # https://github.com/dotcloud/docker/issues/5359 + while [ ! -f $pidfile ]; do + sleep 1 + done success echo else