blob: 60f83a320f4435583c932b1bf78317251b809445 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# 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 >/dev/null 2>&1 && 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."
sleep ${long}
echo $UPSTART_JOB "gave up waiting for a network device."
: > /var/lib/cloud/data/no-net
end script
# EOF
|