From e053f49272e46c2ba941cbd3fd8bf07b089b2917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 16 Dec 2021 09:46:26 +0100 Subject: [PATCH 1/2] units: enable systemd-network-generator by default It is used by udevd and networkd. Since udevd is enabled statically, let's also change the preset to "on". networkd is opt-in, so let's pull in the generator when enabling networkd too. --- presets/90-systemd.preset | 2 +- units/systemd-networkd.service.in | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/presets/90-systemd.preset b/presets/90-systemd.preset index 8a1a08210c..25936d8f57 100644 --- a/presets/90-systemd.preset +++ b/presets/90-systemd.preset @@ -18,6 +18,7 @@ enable machines.target enable getty@.service enable systemd-timesyncd.service enable systemd-networkd.service +enable systemd-network-generator.service enable systemd-resolved.service enable systemd-homed.service enable systemd-userdbd.socket @@ -37,7 +38,6 @@ disable exit.target disable systemd-networkd-wait-online.service disable systemd-time-wait-sync.service disable systemd-boot-check-no-failures.service -disable systemd-network-generator.service disable proc-sys-fs-binfmt_misc.mount disable syslog.socket diff --git a/units/systemd-networkd.service.in b/units/systemd-networkd.service.in index 6acce036df..95dd2665b2 100644 --- a/units/systemd-networkd.service.in +++ b/units/systemd-networkd.service.in @@ -56,6 +56,10 @@ WantedBy=multi-user.target Also=systemd-networkd.socket Alias=dbus-org.freedesktop.network1.service +# The output from this generator is used by udevd and networkd. Enable it by +# default when enabling systemd-networkd.service. +Also=systemd-network-generator.service + # We want to enable systemd-networkd-wait-online.service whenever this service # is enabled. systemd-networkd-wait-online.service has # WantedBy=network-online.target, so enabling it only has an effect if From 66aaca688f46e1c33016f88d94cc1647f53ddf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 16 Dec 2021 09:56:13 +0100 Subject: [PATCH 2/2] man: split out a paragraph and shorten the text about sd-network-generator The ordering of the service wrt. to udevd is enforced by unit configuration, so no need to tell the user about this. From users' POV, the only thing that counts is that the unit is enabled and then the right thing happens. --- man/systemd-udevd.service.xml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/man/systemd-udevd.service.xml b/man/systemd-udevd.service.xml index 1bc86469be..3107fb7ce9 100644 --- a/man/systemd-udevd.service.xml +++ b/man/systemd-udevd.service.xml @@ -234,13 +234,14 @@ systemd.link5 for more details. When the MAC address is specified, the policies are applied to the interface which has the address. When no MAC address is specified, the policies are applied - to all interfaces. This kernel command line argument can be specified multiple times. This - argument is not directly read from systemd-udevd, but read and converted - to a .link file by systemd-network-generator. So, to make this argument - take effect, systemd-network-generator.service must be enabled and - started before starting systemd-udevd.service. See - systemd-network-generator.service8 - for more details about the service. + to all interfaces. This kernel command line argument can be specified multiple times. + + This argument is not directly read by systemd-udevd, but is instead + converted to a .link file by + systemd-network-generator.service8. + For this argument to take effect, systemd-network-generator.service must be + enabled. + Example: net.ifname-policy=keep,kernel,path,slot,onboard,01:23:45:67:89:ab net.ifname-policy=keep,kernel,path,slot,onboard,mac