~smoser/cloud-init/trunk.1562918

Viewing all changes in revision 1190.

  • Committer: Scott Moser
  • Date: 2016-03-29 13:11:25 UTC
  • mfrom: (1189.1.1 trunk.improve-wait)
  • Revision ID: smoser@ubuntu.com-20160329131125-alpk0w3kdj3jvi7v
improve how cloud-init-wait waits

Instead of sleep and check loop, use 'udevadm settle' to wait.
since we run from a udev event, this is sufficient.
udev settle will exit when either of
   a.) the file exists
   b.) the udev event queue has all been processed.
   c.) timeout is reached.

Since cloud-init-wait is being run as a udev event, 'b' cannot
be satisfied until it finishes. Thus, this essentially becomes a
inotify based wait for the file /run/cloud-init/network-config-ready
and no loops are needed.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: