[ec2] User data script.

Scott Moser scott.moser at canonical.com
Fri Sep 4 16:45:13 BST 2009


On Fri, 4 Sep 2009, Rodney T. Quillo wrote:

>
> After applying the patch and bundling the image for testing.

I can't 100% speak for re-bundling of the image.  When I did my test
before replying to you last time, I removed the lock files in
/var/lib/ec2/ and then rebooted.

unfortunately, re-bundling isn't something that is well tested or
documented at the moment.

> It added in my user-data script the line '/usr/sbin/ec2-set-apt-sources'
> before calling apt-get update. See below.

I verified that the following script functions to update the image using
the karmic alpha 5 AMI:

ec2-run-instances ami-3520c05c --key ${EC2_KEYPAIR} \
   --instance-type m1.small --user-data-file=my-user-data

where my-user-data contains the following.  you shouldn't need the
'ec2-set-apt-sources', which no longer exists.  After running, there is
the log in /var/run/user-data.output
##############
#!/bin/bash
{
set -e -x

export DEBIAN_FRONTEND=noninteractive
#/usr/sbin/ec2-set-apt-sources

apt-get update && apt-get -y upgrade

apt-get -y install apache2

} > /var/run/user-data.output 2>&1
#############

> Seems /etc/init.d/ec2-init was set to run the ec2-run-user-data first before
> setting the apt source..?
>
> Btw, when will the Canonical Hardy with user data will be released? :)

I hope to release refreshed versions of hardy AMIs within the next 2
weeks. The bugs that we'll make sure are fixed are at
https://bugs.launchpad.net/ubuntu-on-ec2/hardy/+bugs



More information about the Ubuntu-ec2 mailing list