summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
Diffstat (limited to 'udev')
-rwxr-xr-xudev/cloud-init-wait5
1 files changed, 5 insertions, 0 deletions
diff --git a/udev/cloud-init-wait b/udev/cloud-init-wait
index 9df502e3..b434005d 100755
--- a/udev/cloud-init-wait
+++ b/udev/cloud-init-wait
@@ -9,6 +9,11 @@ DEBUG=0
block_until_ready() {
local fname="$1" max="$2"
[ -f "$fname" ] && return 0
+ # udevadm settle below will exit at the first of 3 conditions
+ # 1.) timeout 2.) file exists 3.) all in-flight udev events are processed
+ # since this is being run from a udev event, the 3 wont happen.
+ # thus, this is essentially a inotify wait or timeout on a file in /run
+ # that is created by cloud-init-local.
udevadm settle "--timeout=$max" "--exit-if-exists=$fname"
}