-
Notifications
You must be signed in to change notification settings - Fork 656
-
Notifications
You must be signed in to change notification settings - Fork 656
Cloud-init script issues #1106
Comments
Not sure if this is helpful: /opt/rancher/bin/start.sh <- runs before docker has started (and you need to write these scripts from your cloud-config.yml) |
I am unable to reproduce. I started a AWS instance using this simple script
I was able to SSH into the instance using the key pair provided in the UI and able to see that the script ran. Can you try rebooting your box and see if you can ssh in after that ? Or can you get an "instance screenshot" of it? |
I think @ispyinternet has the right idea. My script is trying to run docker commands and failing. |
@deniseschannon the instance screenshot just shows 'Booting Kernel' I actually just terminated the instance to try using cloud-config to put something in rc.local instead, but I can launch another one if you think it is worthwhile. My guess is that it is because I'm trying to use docker commands before the daemon is loaded. |
The "Booting Kernel" message happens really early in the boot process, so that's probably not related to cloud-config. If you don't mind, I do think trying again would be worthwhile. It seems odd to be that an error in the script execution would affect the system in anyway. |
My 2 cents: I had a similar problem and just used a sleep to fix it, but... it's not ideal. And as @drpebcak mentioned on IRC, it may not be good to use this with reboots. (same issue with 0.4.5 and 0.5.0).
I also have issues with different scripts, like automatically creating RancherOS hosts with SpotInst. |
@deniseschannon, @joshwget I'm spinning up a new host, rancherOS v0.5.0, and passing it this as userdata:
I've verified that an instance with the same settings (but without userdata) is accessible. I will wait a few minutes to see if I can SSH into the new instance. |
Hmm.. and now I can't seem to replicate it. It definitely doesn't start rancher-server, but it isn't freezing up the instance anymore. I'm going to close this because it seems like it's invalid. |
Copy & paste in the user data of aws instance #cloud-config
|
Official way to deal with this: https://rancher.com/docs/os/v1.2/en/configuration/running-commands/#running-docker-commands
|
looks like there is also https://rancher.com/docs/os/v1.x/en/installation/system-services/custom-system-services/#launching-services-through-cloud-config
|
RancherOS Version: (ros os version)
v0.5.0
Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)
AWS
I am trying to use userdata to run a script when I start new instances. However, the script doesn't seem to execute, and my instance is unreachable via ssh (going on about 12 hours now).
Even a simple script like this one doesn't work:
The text was updated successfully, but these errors were encountered: