From 2a73e674605916077cf6a87410f4ad0829938400 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 29 Feb 2016 23:10:44 -0500 Subject: add cloud-init.target, update service files accordingly This adds cloud-init.target which is a single target to encompass all the services of cloud-init. --- systemd/cloud-init-local.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'systemd/cloud-init-local.service') diff --git a/systemd/cloud-init-local.service b/systemd/cloud-init-local.service index a31985c6..73aa46f6 100644 --- a/systemd/cloud-init-local.service +++ b/systemd/cloud-init-local.service @@ -13,4 +13,4 @@ TimeoutSec=0 StandardOutput=journal+console [Install] -WantedBy=multi-user.target +WantedBy=cloud-init.target -- cgit v1.2.3 From 2eb86ca13cb658b51440bb28cab47205b641d0ee Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 10 Mar 2016 10:32:08 -0500 Subject: initial systemd service suggestions provided by pitti This should mean that cloud-init-local is running earlier now (DefaultDependencies=no). And also blocking networking coming up (Before=network-pre.target) cloud-init.service should now actually block network-online.target from being made (meaning it will run before anything that expects that) but after networking.service, which is what actually does the bringup on ifupdown / ubuntu. --- systemd/cloud-init-local.service | 4 ++++ systemd/cloud-init.service | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'systemd/cloud-init-local.service') diff --git a/systemd/cloud-init-local.service b/systemd/cloud-init-local.service index 73aa46f6..475a2e11 100644 --- a/systemd/cloud-init-local.service +++ b/systemd/cloud-init-local.service @@ -1,7 +1,11 @@ [Unit] Description=Initial cloud-init job (pre-networking) +DefaultDependencies=no Wants=local-fs.target After=local-fs.target +Conflicts=shutdown.target +Before=network-pre.target +Before=shutdown.target [Service] Type=oneshot diff --git a/systemd/cloud-init.service b/systemd/cloud-init.service index 1f656f7f..6fb655e6 100644 --- a/systemd/cloud-init.service +++ b/systemd/cloud-init.service @@ -1,8 +1,8 @@ [Unit] Description=Initial cloud-init job (metadata service crawler) -After=local-fs.target network-online.target cloud-init-local.service -Before=sshd.service sshd-keygen.service systemd-user-sessions.service -Requires=network-online.target +After=cloud-init-local.service networking.service +Before=network-online.target sshd.service sshd-keygen.service systemd-user-sessions.service +Requires=networking.service Wants=local-fs.target cloud-init-local.service sshd.service sshd-keygen.service [Service] -- 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/cloud-init-local.service') 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/cloud-init-local.service') 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/cloud-init-local.service') 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