summaryrefslogtreecommitdiff
path: root/systemd
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2017-06-13 09:06:41 -0500
committerScott Moser <smoser@brickies.net>2017-07-19 17:52:32 -0400
commitdcbe479575fac9f293c5c4089f4bcb46ab887206 (patch)
tree43fbeea7110338747135af20f9b702200f7c2607 /systemd
parent97abd83513bee191b58f095f4d683b18acce0b49 (diff)
downloadvyos-cloud-init-dcbe479575fac9f293c5c4089f4bcb46ab887206.tar.gz
vyos-cloud-init-dcbe479575fac9f293c5c4089f4bcb46ab887206.zip
Templatize systemd unit files for cross distro deltas.
Under el7, cloud-init systemd files need some unit tweaks to ensure they run at the right time. Pull in current el7 downstream systemd unit changes.
Diffstat (limited to 'systemd')
-rw-r--r--systemd/cloud-config.service.tmpl (renamed from systemd/cloud-config.service)1
-rw-r--r--systemd/cloud-final.service.tmpl (renamed from systemd/cloud-final.service)6
-rw-r--r--systemd/cloud-init-local.service.tmpl (renamed from systemd/cloud-init-local.service)5
-rw-r--r--systemd/cloud-init.service.tmpl (renamed from systemd/cloud-init.service)10
4 files changed, 20 insertions, 2 deletions
diff --git a/systemd/cloud-config.service b/systemd/cloud-config.service.tmpl
index 3309e08a..bdee3ce0 100644
--- a/systemd/cloud-config.service
+++ b/systemd/cloud-config.service.tmpl
@@ -1,3 +1,4 @@
+## template:jinja
[Unit]
Description=Apply the settings specified in cloud-config
After=network-online.target cloud-config.target
diff --git a/systemd/cloud-final.service b/systemd/cloud-final.service.tmpl
index 66f5b8fc..fc01b891 100644
--- a/systemd/cloud-final.service
+++ b/systemd/cloud-final.service.tmpl
@@ -1,6 +1,10 @@
+## template:jinja
[Unit]
Description=Execute cloud user/final scripts
-After=network-online.target cloud-config.service rc-local.service multi-user.target
+After=network-online.target cloud-config.service rc-local.service
+{% if variant in ["ubuntu", "unknown", "debian"] %}
+After=multi-user.target
+{% endif %}
Wants=network-online.target cloud-config.service
Before=apt-daily.service
diff --git a/systemd/cloud-init-local.service b/systemd/cloud-init-local.service.tmpl
index 7ee43eda..ff9c644d 100644
--- a/systemd/cloud-init-local.service
+++ b/systemd/cloud-init-local.service.tmpl
@@ -1,13 +1,18 @@
+## template:jinja
[Unit]
Description=Initial cloud-init job (pre-networking)
+{% if variant in ["ubuntu", "unknown", "debian"] %}
DefaultDependencies=no
+{% endif %}
Wants=network-pre.target
After=systemd-remount-fs.service
Before=NetworkManager.service
Before=network-pre.target
Before=shutdown.target
+{% if variant in ["ubuntu", "unknown", "debian"] %}
Before=sysinit.target
Conflicts=shutdown.target
+{% endif %}
RequiresMountsFor=/var/lib/cloud
[Service]
diff --git a/systemd/cloud-init.service b/systemd/cloud-init.service.tmpl
index 39acc20a..2c71889d 100644
--- a/systemd/cloud-init.service
+++ b/systemd/cloud-init.service.tmpl
@@ -1,3 +1,4 @@
+## template:jinja
[Unit]
Description=Initial cloud-init job (metadata service crawler)
DefaultDependencies=no
@@ -6,13 +7,20 @@ Wants=sshd-keygen.service
Wants=sshd.service
After=cloud-init-local.service
After=systemd-networkd-wait-online.service
+{% if variant in ["ubuntu", "unknown", "debian"] %}
After=networking.service
+{% endif %}
+{% if variant in ["centos", "fedora", "redhat"] %}
+After=network.service
+{% endif %}
Before=network-online.target
Before=sshd-keygen.service
Before=sshd.service
+{% if variant in ["ubuntu", "unknown", "debian"] %}
Before=sysinit.target
-Before=systemd-user-sessions.service
Conflicts=shutdown.target
+{% endif %}
+Before=systemd-user-sessions.service
[Service]
Type=oneshot