ec2-init: ec2-set-hostname should be eliminated, trust DHCP
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EC2 init scripts |
Fix Released
|
Undecided
|
Unassigned | ||
Ubuntu on EC2 |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
As Patrick J. McNerthney pointed out, the fix for bug #352745 still leaves some problems in place for images created from rebundled running instances.
New instances created from the rebundled image start with an /etc/hosts containing the internal DNS name of the old instance.
Attempting to fix this by overwriting the hostname could overwrite some hostname which the user intended to be put in place in /etc/hosts.
My recommendation at this point is to follow the practice I've been using forever in the Ubuntu images for EC2 I publish on http://
The EC2 images would be created with no /etc/hostname file and with an /etc/hosts file which contains no entry for 127.0.1.1. There would be no need for the ec2-set-hostname startup script.
I'm opening a new bug report because reading through bug #352745 might lead to some confusion with the back and forth as seen by the fact that Patrick's reported problem has not been corrected.
This bug also replaces bug #402273 since /etc/hostname would not exist.
description: | updated |
summary: |
- ec2-set-hostname should be eliminated, trust DHCP + ec2-init: ec2-set-hostname should be eliminated, trust DHCP |
Changed in ec2-init: | |
status: | New → Confirmed |
Changed in ubuntu-on-ec2: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
The goal is to have the hostname set to whatever EC2 provides.
I've changed ec2-set-hostname so that it doesn't instrument /etc/hosts anymore.
Using ec2-set-hostname with a generic name in /etc/hostname sets a hostname /very/ early in the boot process (rcS.d/ S02hostname. sh), which then gets overridden by hostname.
Without an /etc/hostname, there is no hostname set until dhcp runs.
On EC2, this should for almost all intents and purposes, not matter AFAICS. However, having an /etc/hostname in the image means one less EC2 special case in VMBuilder and also aids in my own testing (having a hostname set early on makes it easier to compare syslogs afterwards).
For this reason, I'm leaving ec2-set-hostname around, at least for the time being.