Zbigniew Jędrzejewski-Szmek f4a676
From edfdd314c82f42d2e571a24d6a8bdc674a892b43 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek f4a676
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Zbigniew Jędrzejewski-Szmek f4a676
Date: Mon, 27 Mar 2017 06:55:55 -0400
Zbigniew Jędrzejewski-Szmek f4a676
Subject: [PATCH] units: make enablement of s-n-wait-online.service follow
Zbigniew Jędrzejewski-Szmek f4a676
 systemd-networkd.service (#5635)
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
In 58a6dd15582c038a25bd7059435833943e2e4617 s-n-wait-online.service was added
Zbigniew Jędrzejewski-Szmek f4a676
to presets to synchronize the presets with the state after installation. But it
Zbigniew Jędrzejewski-Szmek f4a676
is harmful to have s-n-wait-online.service enabled when s-n.service is
Zbigniew Jędrzejewski-Szmek f4a676
disabled, because s-n-wait-online.service has Requsite=s-n.service and cannot
Zbigniew Jędrzejewski-Szmek f4a676
be activated. Thus remove s-n-wait-online.service from presets again, and let
Zbigniew Jędrzejewski-Szmek f4a676
it be enabled whenever s-n.service is enabled.
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
During installation we create enablement symlinks by hand, and since s-n.service
Zbigniew Jędrzejewski-Szmek f4a676
is enabled, s-n-w-o.service should be enabled too, so the symlink should still
Zbigniew Jędrzejewski-Szmek f4a676
be created during installation.
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
https://bugzilla.redhat.com/show_bug.cgi?id=1433459#c15(cherry picked from commit 9e49656037717b96c06b1f1507a41550bdb2c795)
Zbigniew Jędrzejewski-Szmek f4a676
---
Zbigniew Jędrzejewski-Szmek f4a676
 system-preset/90-systemd.preset      | 1 -
Zbigniew Jędrzejewski-Szmek f4a676
 units/systemd-networkd.service.m4.in | 6 ++++++
Zbigniew Jędrzejewski-Szmek f4a676
 2 files changed, 6 insertions(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
diff --git a/system-preset/90-systemd.preset b/system-preset/90-systemd.preset
Zbigniew Jędrzejewski-Szmek f4a676
index 6b5349dc8d..3ba4bb760d 100644
Zbigniew Jędrzejewski-Szmek f4a676
--- a/system-preset/90-systemd.preset
Zbigniew Jędrzejewski-Szmek f4a676
+++ b/system-preset/90-systemd.preset
Zbigniew Jędrzejewski-Szmek f4a676
@@ -15,7 +15,6 @@ enable getty@.service
Zbigniew Jędrzejewski-Szmek f4a676
 enable systemd-timesyncd.service
Zbigniew Jędrzejewski-Szmek f4a676
 enable systemd-networkd.service
Zbigniew Jędrzejewski-Szmek f4a676
 enable systemd-resolved.service
Zbigniew Jędrzejewski-Szmek f4a676
-enable systemd-networkd-wait-online.service
Zbigniew Jędrzejewski-Szmek f4a676
 
Zbigniew Jędrzejewski-Szmek f4a676
 disable console-getty.service
Zbigniew Jędrzejewski-Szmek f4a676
 disable debug-shell.service
Zbigniew Jędrzejewski-Szmek f4a676
diff --git a/units/systemd-networkd.service.m4.in b/units/systemd-networkd.service.m4.in
Zbigniew Jędrzejewski-Szmek f4a676
index d1cf3fc133..2623b21947 100644
Zbigniew Jędrzejewski-Szmek f4a676
--- a/units/systemd-networkd.service.m4.in
Zbigniew Jędrzejewski-Szmek f4a676
+++ b/units/systemd-networkd.service.m4.in
Zbigniew Jędrzejewski-Szmek f4a676
@@ -39,3 +39,9 @@ SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @mount @obsolete
Zbigniew Jędrzejewski-Szmek f4a676
 [Install]
Zbigniew Jędrzejewski-Szmek f4a676
 WantedBy=multi-user.target
Zbigniew Jędrzejewski-Szmek f4a676
 Also=systemd-networkd.socket
Zbigniew Jędrzejewski-Szmek f4a676
+
Zbigniew Jędrzejewski-Szmek f4a676
+# We want to enable systemd-networkd-wait-online.service whenever this service
Zbigniew Jędrzejewski-Szmek f4a676
+# is enabled. systemd-networkd-wait-online.service has
Zbigniew Jędrzejewski-Szmek f4a676
+# WantedBy=network-online.target, so enabling it only has an effect if
Zbigniew Jędrzejewski-Szmek f4a676
+# network-online.target itself is enabled or pulled in by some other unit.
Zbigniew Jędrzejewski-Szmek f4a676
+Also=systemd-networkd-wait-online.service