From 519c0936e3e80fc14225e500fbb61d0d12d28c35 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 18 Mar 2016 20:40:54 -0400 Subject: commit the systemd waiting mechanism Note, still broken as cloud-init local is not going to ever touch the CI_NET_READY file (/run/cloud-init/network-config-ready). So as this is , it will actually just block for 60 seconds and go on. --- systemd/cloud-init-generator | 3 +++ 1 file changed, 3 insertions(+) (limited to 'systemd') diff --git a/systemd/cloud-init-generator b/systemd/cloud-init-generator index 2d319695..ae286d58 100755 --- a/systemd/cloud-init-generator +++ b/systemd/cloud-init-generator @@ -107,6 +107,9 @@ main() { "ln $CLOUD_SYSTEM_TARGET $link_path" fi fi + # this touches /run/cloud-init/enabled, which is read by + # udev/cloud-init-wait. If not present, it will exit quickly. + touch "$LOG_D/$ENABLE" elif [ "$result" = "$DISABLE" ]; then if [ -f "$link_path" ]; then if rm -f "$link_path"; then -- cgit v1.2.3 From 1c8e0d93bb48338777e689e6303702bf84fed0d1 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 18 Mar 2016 20:47:06 -0400 Subject: cloud-init-local.service: touch file that cloud-init-wait will wait for this might work. And if it does means we could generally test this as the file that the cloud-init-wait will wait for will actually get created. --- systemd/cloud-init-local.service | 3 +++ 1 file changed, 3 insertions(+) (limited to 'systemd') diff --git a/systemd/cloud-init-local.service b/systemd/cloud-init-local.service index 475a2e11..f3a92e2f 100644 --- a/systemd/cloud-init-local.service +++ b/systemd/cloud-init-local.service @@ -10,6 +10,9 @@ Before=shutdown.target [Service] Type=oneshot ExecStart=/usr/bin/cloud-init init --local +## FIXME: remove this when cloud-initn local does it itself +## or otherwise better signals any blocking udev events +ExecStopPost=touch /run/cloud-init/network-config-ready RemainAfterExit=yes TimeoutSec=0 -- cgit v1.2.3 From 16751f75a51814e4873199eddec15040dd221561 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Sun, 20 Mar 2016 22:31:21 -0400 Subject: fix creation of network-config-ready and dont bother waiting on lo --- systemd/cloud-init-local.service | 4 +--- udev/cloud-init-wait | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'systemd') diff --git a/systemd/cloud-init-local.service b/systemd/cloud-init-local.service index f3a92e2f..dd737644 100644 --- a/systemd/cloud-init-local.service +++ b/systemd/cloud-init-local.service @@ -10,9 +10,7 @@ Before=shutdown.target [Service] Type=oneshot ExecStart=/usr/bin/cloud-init init --local -## FIXME: remove this when cloud-initn local does it itself -## or otherwise better signals any blocking udev events -ExecStopPost=touch /run/cloud-init/network-config-ready +ExecStart=/bin/touch /run/cloud-init/network-config-ready RemainAfterExit=yes TimeoutSec=0 diff --git a/udev/cloud-init-wait b/udev/cloud-init-wait index f27309e3..7d53dee4 100755 --- a/udev/cloud-init-wait +++ b/udev/cloud-init-wait @@ -52,6 +52,10 @@ main() { return 0 fi + if [ "${INTERFACE#lo}" != "$INTERFACE" ]; then + return 0 + fi + block_until_ready "$readyfile" .1 600 || { log "failed waiting for ready on $INTERFACE"; return 1; } -- cgit v1.2.3 From 7a22e352b2f87636554d9787f60cd3168f3d77bc Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 21 Mar 2016 08:59:55 -0400 Subject: cloud-init-local needs to want network-pre or it isnt guaranteed to start --- systemd/cloud-init-local.service | 1 + 1 file changed, 1 insertion(+) (limited to 'systemd') diff --git a/systemd/cloud-init-local.service b/systemd/cloud-init-local.service index dd737644..b19eeaee 100644 --- a/systemd/cloud-init-local.service +++ b/systemd/cloud-init-local.service @@ -2,6 +2,7 @@ Description=Initial cloud-init job (pre-networking) DefaultDependencies=no Wants=local-fs.target +Wants=network-pre.target After=local-fs.target Conflicts=shutdown.target Before=network-pre.target -- cgit v1.2.3