# Wait-for-docker not working?

**URL:** <https://forums.suse.com/t/wait-for-docker-not-working/5420>\
**Category:** RancherOS\
**Created:** [February 5, 2017, 4:33pm UTC](https://forums.suse.com/t/wait-for-docker-not-working/5420 "2017-02-05T16:33:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![huggla](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/huggla/32/3050_2.png) [@huggla](https://forums.suse.com/u/huggla)\
**Post date:** [February 5, 2017, 4:33pm UTC](https://forums.suse.com/t/wait-for-docker-not-working/5420/1 "2017-02-05T16:33:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SvenDowideit](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/svendowideit/32/2159_2.png) [@SvenDowideit](https://forums.suse.com/u/SvenDowideit)\
**Post date:** [February 5, 2017, 11:17pm UTC](https://forums.suse.com/t/wait-for-docker-not-working/5420/2 "2017-02-05T23:17:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![huggla](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/huggla/32/3050_2.png) [@huggla](https://forums.suse.com/u/huggla)\
**Post date:** [February 6, 2017, 9:01am UTC](https://forums.suse.com/t/wait-for-docker-not-working/5420/3 "2017-02-06T09:01:15Z")

</div>

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://...
```
