From 4685dd287c9eea18dc18bac1260b7a1169271f78 Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Mon, 9 Feb 2009 19:12:09 +0000 Subject: * ec2-set-apt-sources.py - Determine the zone that the user is in and generate a /etc/apt/sources.list.d/ based on that. * debian/init: - Check to see if there is an /var/run/ec2 and create it if it doesnt exist. - Start ec2-set-apt-sources at first bootup. * debian/rules: - Install ec2-set-apt-sources. * debian/control: - Add python-configobj as a dependency. * debian/{install,dirs} - Create an /etc/ec2-init to read the configuration file and install it. --- debian/init | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'debian/init') diff --git a/debian/init b/debian/init index e28edd06..1e5a36c1 100644 --- a/debian/init +++ b/debian/init @@ -16,6 +16,10 @@ NAME=ec2-init . /lib/lsb/init-functions +if [ ! -d /var/run/ec2 ]; then + mkdir /var/run/ec2 +fi + case "$1" in start) log_daemon_msg "Fetching EC2 login credentials" @@ -51,6 +55,13 @@ case "$1" in else log_end_msg 1 fi + log_daemon_msg "Determining EC2 availability zone" + if ec2-set-apt-sources.py 2> /dev/null + then + log_end_msg 0 + else + log_end_msg 1 + fi ;; stop) -- cgit v1.2.3