summaryrefslogtreecommitdiff
path: root/debian/init
diff options
context:
space:
mode:
authorChuck Short <zulcss@ubuntu.com>2009-02-09 19:12:09 +0000
committerBazaar Package Importer <jamesw@ubuntu.com>2009-02-09 19:12:09 +0000
commit4685dd287c9eea18dc18bac1260b7a1169271f78 (patch)
tree79738235d552663619932980d46f9a9e004aeb2e /debian/init
parent40bc760f17a67700ad19b0d2250deec4e5e06954 (diff)
downloadvyos-cloud-init-4685dd287c9eea18dc18bac1260b7a1169271f78.tar.gz
vyos-cloud-init-4685dd287c9eea18dc18bac1260b7a1169271f78.zip
* 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.
Diffstat (limited to 'debian/init')
-rw-r--r--debian/init11
1 files changed, 11 insertions, 0 deletions
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)