diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-02-18 15:12:04 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-02-18 15:12:04 -0500 |
commit | b36409906bb374ea17e5fd3f7e0a9eda93fed4fa (patch) | |
tree | 578dcd8e44853da480fc98c9ee55cc70117c00ad /upstart | |
parent | 260ef3428a6c4a4bd148a4d5f1a7488e895f83ee (diff) | |
download | vyos-cloud-init-b36409906bb374ea17e5fd3f7e0a9eda93fed4fa.tar.gz vyos-cloud-init-b36409906bb374ea17e5fd3f7e0a9eda93fed4fa.zip |
improve startup if no eth0 is available (LP: #714807)
LP: #714807
Diffstat (limited to 'upstart')
-rw-r--r-- | upstart/cloud-init-nonet.conf | 22 | ||||
-rw-r--r-- | upstart/cloud-init.conf | 3 |
2 files changed, 23 insertions, 2 deletions
diff --git a/upstart/cloud-init-nonet.conf b/upstart/cloud-init-nonet.conf new file mode 100644 index 00000000..2ac98286 --- /dev/null +++ b/upstart/cloud-init-nonet.conf @@ -0,0 +1,22 @@ +# cloud-init-no-net +# the purpose of this job is +# * to block running of cloud-init until a non 'lo' interface is up +# * timeout if one doens't come up in a reasonable amount of time +start on mounted MOUNTPOINT=/ and stopped cloud-init-local +stop on net-device-up IFACE!=lo +task + +console output + +script + # if a non 'lo' interface is up, exit immediately + grep -qv '^lo' /var/run/network/ifstate && exit 0 + + [ -f /var/lib/cloud/instance/obj.pkl ] && exit 0 + sleep 10 + echo $UPSTART_JOB "waiting for a network device." + sleep 60 + echo $UPSTART_JOB "gave up waiting for a network device." + : > /var/lib/cloud/data/no-net +end script +# EOF diff --git a/upstart/cloud-init.conf b/upstart/cloud-init.conf index cb2b437b..b9be5981 100644 --- a/upstart/cloud-init.conf +++ b/upstart/cloud-init.conf @@ -1,7 +1,6 @@ # cloud-init - the initial cloud-init job # crawls metadata service, emits cloud-config -start on (mounted MOUNTPOINT=/ and net-device-up IFACE=eth0 and \ - stopped cloud-init-local ) +start on mounted MOUNTPOINT=/ and stopped cloud-init-nonet task |