diff --git a/contrib/init/sysvinit-redhat/docker b/contrib/init/sysvinit-redhat/docker index 2b75c6903f..06699f6ab1 100755 --- a/contrib/init/sysvinit-redhat/docker +++ b/contrib/init/sysvinit-redhat/docker @@ -3,7 +3,7 @@ # /etc/rc.d/init.d/docker # # Daemon for docker.io -# +# # chkconfig: 2345 95 95 # description: Daemon for docker.io @@ -49,6 +49,13 @@ start() { $exec -d $other_args &>> $logfile & pid=$! touch $lockfile + # wait up to 10 seconds for the pidfile to exist. see + # https://github.com/dotcloud/docker/issues/5359 + tries=0 + while [ ! -f $pidfile -a $tries -lt 10 ]; do + sleep 1 + tries=$((tries + 1)) + done success echo else