Wait-for-docker not working?

I’m running docker commands during boot by the rc.local method described here:
http://docs.rancher.com/os/configuration/running-commands/

But the wait-for-docker command doesn’t seem to work as expected. I still need to add a sleep command for the docker command to execute. I’m using RancherOS 0.7.1

Heya,

I just copied the example from there and it appears to work - could you give us more detail so we can reproduce what you’re seeing?

Sven

I’m not creating the rc.local in the cloud-config with write_file. Instead I have a pre made rc.local symlinked into /etc.

#cloud-config
mounts:
- ["/dev/sda", "/home/rancher", "ext4", ""]
runcmd:
- [ ln, -sf, /home/rancher/rc.local, /etc/rc.local ]

This rc.local doesn’t work:

#!/bin/bash
wait-for-docker
docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.1.3 http://...

This works:

#!/bin/bash
wait-for-docker
sleep 5
docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.1.3 http://...