By neil323125
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!
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 underruncmd. Instead, the/etc/rc.localscript can be used. RancherOS will not wait for commands in this script to complete, so you can use thewait-for-dockercommand 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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.