diff options
Diffstat (limited to 'upstart/cloud-init-nonet.conf')
| -rw-r--r-- | upstart/cloud-init-nonet.conf | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/upstart/cloud-init-nonet.conf b/upstart/cloud-init-nonet.conf index 12f21320..70c7dfea 100644 --- a/upstart/cloud-init-nonet.conf +++ b/upstart/cloud-init-nonet.conf @@ -1,19 +1,25 @@ # 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 +# * to block running of cloud-init until all network interfaces +# configured in /etc/network/interfaces are up +# * timeout if they all do not come up in a reasonable amount of time start on mounted MOUNTPOINT=/ and stopped cloud-init-local -stop on net-device-up IFACE!=lo +stop on static-network-up task console output script - # if a non 'lo' interface is up, exit immediately - grep -qv '^lo' /var/run/network/ifstate >/dev/null 2>&1 && exit 0 + # /run/network/static-network-up-emitted is written by + # upstart (via /etc/network/if-up.d/upstart). its presense would + # indicate that static-network-up has already fired. + EMITTED="/run/network/static-network-up-emitted" + [ -e "$EMITTED" -o -e "/var/$EMITTED" ] && exit 0 [ -f /var/lib/cloud/instance/obj.pkl ] && exit 0 + start networking + short=10; long=60; sleep ${short} echo $UPSTART_JOB "waiting ${long} seconds for a network device." |
