Running the following commands appears to correctly set all the forms of hostname on my Lucid ec2 instance:
echo "$(curl -s http://169.254.169.254/latest/meta-data/local-hostname)" | sed 's:\..*$::' > /etc/hostname /sbin/sysctl -w kernel.hostname="$(curl -s http://169.254.169.254/latest /meta-data/local-hostname | sed 's:\..*$::')" logout/login shell root@ip-10-XXX-181-59:~# uname -n ip-10-XXX-181-59 root@ip-10-XXX-181-59:~# hostname -s ip-10-XXX-181-59 root@ip-10-XXX-181-59:~# hostname -d ec2.internal root@ip-10-XXX-181-59:~# hostname -f ip-10-XXX-181-59.ec2.internal root@ip-10-XXX-181-59:~# hostname ip-10-XXX-181-59 root@ip-10-XXX-181-59:~# echo $HOSTNAME ip-10-XXX-181-59 root@ip-10-XXX-181-59:~# cat /etc/hostname ip-10-XXX-181-59 root@ip-10-XXX-181-59:~# /sbin/sysctl -n kernel.hostname ip-10-XXX-181-59 -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to cloud-init in ubuntu. https://bugs.launchpad.net/bugs/596993 Title: hostname handling needs improvement for elastic-ip and ebs start-stop -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs