From e568aec31051674901047ee577f6e229785cbfc3 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 10 Nov 2016 10:29:24 -0500 Subject: systemd: replace Before=basic.target, dbus.target with sysinit.target Per discussion on bug 1636912 and subsequent feedback on bug 1629797, using: Before=sysinit.target is a simpler solution than what we had implemented: Before=basic.target Before=dbus.target LP: #1629797 --- systemd/cloud-init.service | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'systemd/cloud-init.service') diff --git a/systemd/cloud-init.service b/systemd/cloud-init.service index 5c71b213..03ea87a0 100644 --- a/systemd/cloud-init.service +++ b/systemd/cloud-init.service @@ -8,11 +8,10 @@ Wants=sshd.service After=cloud-init-local.service After=networking.service Requires=networking.service -Before=basic.target -Before=dbus.socket Before=network-online.target Before=sshd-keygen.service Before=sshd.service +Before=sysinit.target Before=systemd-user-sessions.service Conflicts=shutdown.target -- cgit v1.2.3 From f7d6bfadf4c84e702e950851e8001ee8f4e3c4b4 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 10 Nov 2016 10:41:47 -0500 Subject: systemd: networking service adjustments. Here we drop the Requires=networking.service but keep the After=networking.service. The change there is that we no longer force networking.service to run, as the system may not have it or be configured to use it. Second, we add After=systemd-networkd-wait-online.service. That causes us to run after systemd-networkd has brought networking up. The end result is that we now run after both ifupdown or systemd-networkd (if they were going to run) but do not force either to run. One other change is that by dropping Requires=networking.service cloud-init will now run even if networking failed to come up. LP: #1636912 --- systemd/cloud-init.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'systemd/cloud-init.service') diff --git a/systemd/cloud-init.service b/systemd/cloud-init.service index 03ea87a0..85e447d2 100644 --- a/systemd/cloud-init.service +++ b/systemd/cloud-init.service @@ -7,7 +7,7 @@ Wants=sshd-keygen.service Wants=sshd.service After=cloud-init-local.service After=networking.service -Requires=networking.service +After=systemd-networkd-wait-online.service Before=network-online.target Before=sshd-keygen.service Before=sshd.service -- cgit v1.2.3 From bf4010a9c379e2109b030af558033014f9137f47 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 10 Nov 2016 10:49:17 -0500 Subject: systemd: drop both Wants and After local-fs.target Drop mention of local-fs.target from both cloud-init-local.service and cloud-init.service. This could actually could cause a loop in ordering due to cc_mounts writing mount points with: x-systemd.requires=cloud-init.service Rather, we specifically list /var/lib/ and systemd-remount-fs.service in cloud-init-local.service. cloud-init.service will run after cloud-init-local and thus will have these satisfied. --- systemd/cloud-init-local.service | 4 ++-- systemd/cloud-init.service | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'systemd/cloud-init.service') diff --git a/systemd/cloud-init-local.service b/systemd/cloud-init-local.service index 55834ba4..9b3e88fa 100644 --- a/systemd/cloud-init-local.service +++ b/systemd/cloud-init-local.service @@ -1,14 +1,14 @@ [Unit] Description=Initial cloud-init job (pre-networking) DefaultDependencies=no -Wants=local-fs.target Wants=network-pre.target -After=local-fs.target +After=systemd-remount-fs.service Before=basic.target Before=NetworkManager.service Before=network-pre.target Before=shutdown.target Conflicts=shutdown.target +RequiresMountsFor=/var/lib [Service] Type=oneshot diff --git a/systemd/cloud-init.service b/systemd/cloud-init.service index 85e447d2..cde6ed84 100644 --- a/systemd/cloud-init.service +++ b/systemd/cloud-init.service @@ -2,7 +2,6 @@ Description=Initial cloud-init job (metadata service crawler) DefaultDependencies=no Wants=cloud-init-local.service -Wants=local-fs.target Wants=sshd-keygen.service Wants=sshd.service After=cloud-init-local.service -- cgit v1.2.3