Report this

What is the reason for this report?

Should be #cloud-config file be run after the first creation or only after the first reboot? (RancherOS)

Posted on January 24, 2018

I’m using terraform to buld the server, and it does work correctly after the first reboot, but after creation it doesn’t work. What the script is trying to do is to start a rancher service. LIke I said if I reboot the server the rancher service comes up perfectly, but it isn’t coming up after the box is first created.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

The cloud-config file should be run on first boot. Though with RancherOS, there is an important caveat that can sometimes catch people up. From the Rancher docs:

When using runcmd, RancherOS will wait for all commands to complete before starting Docker. As a result, any docker run command should not be placed under runcmd. Instead, the /etc/rc.local script can be used. RancherOS will not wait for commands in this script to complete, so you can use the wait-for-docker command to ensure that the Docker daemon is running before performing any docker run commands.

So if the service depends on Docker, it’s possible that it’s not available yet. Though as it comes up after a reboot, there could be another issue here. Could you share your actual script or an example demonstrating the same behavior? It would help narrow down the problem.

This comment has been deleted

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.