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.
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.