summaryrefslogtreecommitdiff
path: root/debian/init
diff options
context:
space:
mode:
authorSoren Hansen <soren@canonical.com>2009-08-10 14:00:22 +0200
committerSoren Hansen <soren@canonical.com>2009-08-10 14:00:22 +0200
commit19023c5df38964a53b63f77943e3ac1d02d95d6c (patch)
treedc06003c10b15e47c622cb137c517f02e235fb89 /debian/init
parent157e808dce7cca6c1ef310bae0e827c65472fdff (diff)
downloadvyos-cloud-init-19023c5df38964a53b63f77943e3ac1d02d95d6c.tar.gz
vyos-cloud-init-19023c5df38964a53b63f77943e3ac1d02d95d6c.zip
Add new script: ec2-wait-for-meta-data-service.py
It will wait for around half an hour for the ec2 meta data service to turn up and eventually execute the configured bailout command (if any) if it never shows up. Call this as the first thing in the init script.
Diffstat (limited to 'debian/init')
-rw-r--r--debian/init10
1 files changed, 10 insertions, 0 deletions
diff --git a/debian/init b/debian/init
index 2fc4b822..608db7a2 100644
--- a/debian/init
+++ b/debian/init
@@ -70,10 +70,20 @@ regenerate_ssh_host_keys() {
case "$1" in
start)
+ log_daemon_msg "Waiting for EC2 meta-data service"
+ if ec2-wait-for-meta-data-service
+ then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ exit 1
+ fi
+
if run_once_per_ami ssh_host_key_regeneration
then
regenerate_ssh_host_keys
fi
+
update-motd
if run_once_ever ec2-defaults