ec2-init: Move ec2-run-user-data to startup priority S99
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ec2-init (Ubuntu) |
Fix Released
|
Medium
|
Scott Moser | ||
Bug Description
Binary package hint: ec2-init
AMI: ami-a40fefcd canonical-
All of the ec2-init functionality is currently driven by a single /etc/init.
Some of the functionality, like regenerating ssh host keys and setting up authorized_keys, are great to be done before sshd is started.
On the other hand, running the user-data script, should be close to the last thing in the startup process, perhaps S99 (though I've been running it at S71 in my AMIs).
In any case, the user-data script must not be run before sshd is started. When the user-data script takes a long time or gets into an infinite loop, this prevents sshd from running, which prevents the user from being able to ssh in and figure out what went wrong with the startup script.
I ran into this already with a user-data script which waits until an EBS volume is attached (a common boot up function), but the volume was never attached and I couldn't ssh in to the instance to figure out what was going wrong.
Note that the same existing logic should be used to only run the user-data on the first boot of each instance (including rebundled images).
Related branches
Changed in ec2-init (Ubuntu): | |
status: | New → Confirmed |
Changed in ec2-init (Ubuntu): | |
status: | Confirmed → In Progress |
milestone: | none → ubuntu-9.10-beta |
assignee: | nobody → Scott Moser (smoser) |
> On the other hand, running the user-data script, should be close to the last thing in
> the startup process, perhaps S99 (though I've been running it at S71 in my AMIs).
We definitely have things to work on here. But I don't believe its possible to simply say "the user-data script, should be close to the last thing in the startup process".
For example, the user-data script may be doing a upgrade, which would get a new sshd. Ideally you wouldn't have sshd start before that portion of the userdata script had taken place. It may be a contrived example, but the point is in the end, I think we need to build in a lot of flexibility on ordering the running of user-data.