ec2-init: Move wait for network to top level

Bug #407871 reported by Eric Hammond
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
EC2 init scripts
Fix Released
Undecided
Unassigned
Ubuntu on EC2
Fix Released
High
Unassigned

Bug Description

For a while now, I've been recommending that the "wait for network" code be moved out of /usr/sbin/ec2-set-defaults and into something called from the the top level of /etc/init.d/ec2-init , as it doesn't make sense from a code organization perspective to have an important step like this buried inside of a script which has a completely different focus and which just happens to be called first in ec2-init.

I've finally found a bug which is caused by this.

When a running instance is rebundled as a new image and the new image is run as a new instance, the new instance does not wait for the network and may fail to install the public ssh keys correctly, preventing access to the instance. See also bug #308530.

This happens because the call to ec2-set-defaults is inside of a "run once ever" check so the "wait for network" requirement is not run on the new instance of the rebundled image.

This problem may not show up on every instance start as the network may be available more quickly sometimes but not others.

I propose creating a new /usr/sbin/ec2-wait-for-network which does what it says and is called from ec2-init on every boot at the top of "start)".

Related branches

Chuck Short (zulcss)
Changed in ubuntu-on-ec2:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Scott Moser (smoser) wrote :

I believe the fix incorporated for bug 308530 (present in karmic/20090811.2/ubuntu-ec2-karmic-amd64.img.gz) should address your concerns that were listed above. In short, the /etc/init.d/ec2-init script now runs ec2-wait-for-meta-data-service before doing anything else in 'start'. and that program will block until meta-data service is up.

Please re-open if you believe this isn't fixed.

Changed in ec2-init:
status: New → Fix Released
Changed in ubuntu-on-ec2:
status: Confirmed → Fix Released
Revision history for this message
David Favor (davidfavor) wrote :

This bug persists based on today's ec2-init package.

Doing a fresh install of ec2-init hangs forever with "Waiting for EC2 meta-data service".

Revision history for this message
Eric Hammond (esh) wrote :

David, that sounds like a completely different problem from what was being tracked in this bug . Please submit a new bug report with detailed information on how to reproduce.

Revision history for this message
Scott Moser (smoser) wrote : Re: [Bug 407871] Re: ec2-init: Move wait for network to top level

On Wed, 2 Sep 2009, David Favor wrote:

> Doing a fresh install of ec2-init hangs forever with "Waiting for EC2
> meta-data service".

My guess is that you're seeing bug 419306.

The simple workaround is to pass user data either by '--user-data x' or
'--user-data-file some-file'

It doesn't matter what the data is, but it has to be there.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.