landscape-client init script does not wait for the network to be available before checking for EC2 user data

Bug #383336 reported by Christopher Armstrong on 2009-06-03
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Christopher Armstrong

Bug Description

When we started supporting the automatic configuration of cloud-based landscape clients in the init script, we added a hard dependency on the existence of networking support. The init script now downloads user data from the EC2 metadata server, but there are two problems: first, its startup priority is lower than that of "networking" (so I really don't know how it ever works now, but it does), and second, the init script itself does not wait for the interface to come up, which is necessary even if it has a higher priority than the networking startup script, because the networking startup script does not guarantee a working network interface by the time it completes (apparently).

Christopher Armstrong (radix) wrote :

By the way, this is similar to bug #308530 in ubuntu-on-ec2, which they're fixing by putting the following snippet into their startup scripts (or at least, this is the currently-proposed solution):

+def checkServer():
+ for x in range(30*60):
+ s = socket.socket()
+ try:
+ address = ''
+ port = 80
+ s.connect((address,port))
+ s.close()
+ return
+ except socket.error, e:
+ time.sleep(1)

tags: added: review
Thomas Herve (therve) on 2009-06-11
Changed in landscape-client:
assignee: nobody → Christopher Armstrong (radix)
status: New → In Progress

Hey Chris, thanks for cooking up this branch despite illness! Nice
job, +1


+ if time.time() - start > timeout:
+ break

This change doesn't seem to have a test.

Kevin McDermott (bigkevmcd) wrote :

Nice simple fix!



tags: removed: review
Christopher Armstrong (radix) wrote :

Thanks guys. I've added a test for the timeout and merged it to trunk.

Changed in landscape-client:
status: In Progress → Fix Committed
Jamu Kakar (jkakar) on 2009-06-23
tags: added: needs-testing
Christopher Armstrong (radix) wrote :

When the server guys make a test build of their new Ubuntu-on-EC2 AMIs, we'll test it then.

Christopher Armstrong (radix) wrote :

actually, apparently you can reboot a machine in EC2 and it keeps the same filesystem, so we *can* test this. I'll do that soon.

Andreas Hasenack (ahasenack) wrote :

I see the boot order change in the debian/rules file, but what about a package upgrade from a previous version which still starts at level 25 instead of 45 (which is what it was changed to)?

I guess I'll see that once I start the ugprade tests with the final-final-final client.

Changed in landscape-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers