Browse Source

Wait for pidfile to exist when starting with Redhat init script

Fixes #5359

Docker-DCO-1.1-Signed-off-by: Chris St. Pierre <chris.a.st.pierre@gmail.com> (github: stpierre)
Chris St. Pierre 11 years ago
parent
commit
a598dba134
1 changed files with 5 additions and 0 deletions
  1. 5 0
      contrib/init/sysvinit-redhat/docker

+ 5 - 0
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