diff -Nru ec2-init-0.4.999/debian/changelog ec2-init-0.4.999/debian/changelog --- ec2-init-0.4.999/debian/changelog 2009-10-22 14:48:42.000000000 -0400 +++ ec2-init-0.4.999/debian/changelog 2009-10-26 16:21:15.000000000 -0400 @@ -1,3 +1,10 @@ +ec2-init (0.4.999-0ubuntu7) karmic; urgency=low + + * work around differences in eucalyptus ephemeral mounts (LP: #458850) + * get 'ec2:' prefix on ssh public key fingerprint (LP: #458576) + + -- Scott Moser Mon, 26 Oct 2009 16:18:06 -0400 + ec2-init (0.4.999-0ubuntu6) karmic; urgency=low * make sources.list components for 'karmic-security' the same as diff -Nru ec2-init-0.4.999/ec2-init ec2-init-0.4.999/ec2-init --- ec2-init-0.4.999/ec2-init 2009-10-21 18:24:26.000000000 -0400 +++ ec2-init-0.4.999/ec2-init 2009-10-26 16:18:30.000000000 -0400 @@ -58,6 +58,52 @@ echo "#############################################################" } +# fix LP bug 458850 +# the ephemeral mounts provided in eucalyptus instances differ from +# those found in ec2 in 2 ways: +# 1. independent of arch type, the filesystem is on /dev/sda2 +# 2. the filesystem is ext2, not ext3 +fix_euca_fstab() { + + local edev="/dev/sda2" eedev='\/dev\/sda2' + + [ -e "${edev}" ] || return 0 + + local sops=""; # sed operations + local mntinfo="" file_out="" sops="" umdev=${edev} + + # if /dev/sdb is set to mount to /mnt, then we + # want to rewrite that to be /dev/sda2 + mntinfo=$(awk '$2 == "/mnt" { printf("dev=%s fs=%s\n",$1,$3); }' /etc/fstab) + case "${mntinfo}" in + dev=/dev/sdb\ *) + umdev=/dev/sdb; + sops="${sops:+${sops};}s,^/dev/sdb,${edev},";; + esac + + # if fstab says ext3, but fs on edev is ext2, switch fstab + case "${mntinfo}" in + *\ fs=ext3) + file_out=$(file --special-files "${edev}") + case "${file_out}" in + *ext2*) sops="${sops:+${sops};}/^${eedev}/s/ext3/ext2/;";; + esac + ;; + esac + + # if there were no sed operations to preform, then nothing to do + [ -n "${sops}" ] || return 0 + + log_daemon_msg "Fixing fstab for eucalyptus" + sed -i "${sops}" /etc/fstab + # subsequent boots, /etc/fstab will be updated, and the mount + # here isn't needed, but if modifications were made, it is + umount "${edev}" >/dev/null 2>&1 + [ "${edev}" = "${umdev}" ] || umount "${umdev}" >/dev/null 2>&1 + mount "${edev}" + log_end_msg $? +} + case "$1" in start) if ! ec2-is-compat-env --quiet; then @@ -78,6 +124,12 @@ exit 1 fi + # fix euca_fstab for ephemeral mounts one time ever + # on rebundle, it should collect the fixed /etc/fstab + if run_once_ever euca-fix-fstab-for-ephemeral; then + fix_euca_fstab + fi + if run_once_per_ami ssh_host_key_regeneration then # we can't be certain that rsyslog is up (or configured to send @@ -85,8 +137,9 @@ # console. So write to /dev/console directly through tee. # Change priority of message, so if user.notice (logger's default) # also goes to /dev/console , we could avoid dup messages - regenerate_ssh_host_keys 2>&1 | tee /dev/console | - logger -p user.info -s -t "ec2" + regenerate_ssh_host_keys 2>&1 | + logger -p user.info -s -t "ec2" | + tee /dev/console fi if run_once_ever ec2-defaults