From ccdf4ff9966b020a8fd30e5bec87fa82dc20c214 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 17 Mar 2015 15:50:00 -0400 Subject: systemd: update config and final to run even if init jobs fail LP: #1432758 --- systemd/cloud-config.service | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'systemd/cloud-config.service') diff --git a/systemd/cloud-config.service b/systemd/cloud-config.service index 41a86147..ac25c776 100644 --- a/systemd/cloud-config.service +++ b/systemd/cloud-config.service @@ -1,8 +1,7 @@ [Unit] Description=Apply the settings specified in cloud-config -After=network.target syslog.target cloud-config.target -Requires=cloud-config.target -Wants=network.target +After=network.target cloud-config.target syslog.target +Wants=network.target cloud-config.target [Service] Type=oneshot -- cgit v1.2.3 From f4789639af50ea631cf75af526ad013b05670caa Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 9 Apr 2015 11:54:01 -0400 Subject: systemd: use network-online instead of network.target (LP: #1440180) don't declare a Wants/Requires on network.target; this is a passive target that should only be pulled in by implementors of the networking service. The requirement for network needs to be expressed as a dependency on network-online.target. LP: #1440180 --- ChangeLog | 2 ++ systemd/cloud-config.service | 4 ++-- systemd/cloud-final.service | 4 ++-- systemd/cloud-init.service | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'systemd/cloud-config.service') diff --git a/ChangeLog b/ChangeLog index 6651b8eb..ff525337 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,8 @@ - SmartOS: use v2 metadata service (LP: #1436417) [Daniel Watkins] - NoCloud: fix local datasource claiming found without explicit dsmode - Snappy: add support for installing snappy packages and configuring. + - systemd: use network-online instead of network.target (LP: #1440180) + [Steve Langasek] 0.7.6: - open 0.7.6 - Enable vendordata on CloudSigma datasource (LP: #1303986) diff --git a/systemd/cloud-config.service b/systemd/cloud-config.service index ac25c776..f9f1996e 100644 --- a/systemd/cloud-config.service +++ b/systemd/cloud-config.service @@ -1,7 +1,7 @@ [Unit] Description=Apply the settings specified in cloud-config -After=network.target cloud-config.target syslog.target -Wants=network.target cloud-config.target +After=network-online.target cloud-config.target syslog.target +Wants=network-online.target cloud-config.target [Service] Type=oneshot diff --git a/systemd/cloud-final.service b/systemd/cloud-final.service index bbcdf30b..c023ad94 100644 --- a/systemd/cloud-final.service +++ b/systemd/cloud-final.service @@ -1,7 +1,7 @@ [Unit] Description=Execute cloud user/final scripts -After=network.target cloud-config.service syslog.target rc-local.service -Wants=network.target cloud-config.service +After=network-online.target cloud-config.service syslog.target rc-local.service +Wants=network-online.target cloud-config.service [Service] Type=oneshot diff --git a/systemd/cloud-init.service b/systemd/cloud-init.service index 398b90ea..48920283 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.target cloud-init-local.service +After=local-fs.target network-online.target cloud-init-local.service Before=sshd.service sshd-keygen.service systemd-user-sessions.service -Requires=network.target +Requires=network-online.target Wants=local-fs.target cloud-init-local.service sshd.service sshd-keygen.service [Service] -- cgit v1.2.3 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-config.service | 2 +- systemd/cloud-final.service | 2 +- systemd/cloud-init-local.service | 2 +- systemd/cloud-init.service | 2 +- systemd/cloud-init.target | 16 ++++++++++++++++ 5 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 systemd/cloud-init.target (limited to 'systemd/cloud-config.service') diff --git a/systemd/cloud-config.service b/systemd/cloud-config.service index f9f1996e..45d2a63b 100644 --- a/systemd/cloud-config.service +++ b/systemd/cloud-config.service @@ -13,4 +13,4 @@ TimeoutSec=0 StandardOutput=journal+console [Install] -WantedBy=multi-user.target +WantedBy=cloud-init.target diff --git a/systemd/cloud-final.service b/systemd/cloud-final.service index bcbdd36f..bfb08d4a 100644 --- a/systemd/cloud-final.service +++ b/systemd/cloud-final.service @@ -14,4 +14,4 @@ KillMode=process StandardOutput=journal+console [Install] -WantedBy=multi-user.target +WantedBy=cloud-init.target 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 diff --git a/systemd/cloud-init.service b/systemd/cloud-init.service index 48920283..1f656f7f 100644 --- a/systemd/cloud-init.service +++ b/systemd/cloud-init.service @@ -15,4 +15,4 @@ TimeoutSec=0 StandardOutput=journal+console [Install] -WantedBy=multi-user.target +WantedBy=cloud-init.target diff --git a/systemd/cloud-init.target b/systemd/cloud-init.target new file mode 100644 index 00000000..03f61002 --- /dev/null +++ b/systemd/cloud-init.target @@ -0,0 +1,16 @@ +# cloud-init target is enabled by cloud-init-generator +# To disable it you can either: +# a.) boot with kernel cmdline of 'cloudinit=disabled' +# b.) touch a file /etc/cloud/cloud-init.disabled +# cloud-init normally emits a "cloud-config" upstart event to inform third +# parties that cloud-config is available, which does us no good when we're +# using systemd. cloud-config.target serves as this synchronization point +# instead. Services that would "start on cloud-config" with upstart can +# instead use "After=cloud-config.target" and "Wants=cloud-config.target" +# as appropriate. + +[Unit] +Description=Cloud-init target +Wants=cloud-init-local.service cloud-init.service +After=cloud-init-local.service cloud-init.service + -- cgit v1.2.3