From c95aae771d74e11bedc095e92e4c38ce7d25fa59 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 7 Oct 2026 19:56:42 +0200 Subject: interfaces: T3871: name hot-plugged interfaces An interface already in the mapping store is renamed by udev from the generated link file as the device is added. Hardware the system has never seen still has to be assigned a name and recorded, so run the naming pass from a udev rule as well. It holds off until the boot-time configuration has been applied, so the boot storm of add events costs nothing. The rule matches on hardware rather than on its absence. A net device carries no driver itself, it sits below the one that does, so the negative form was true for every interface and skipped the very cards this exists for. --- src/systemd/vyos-net-name-resolve-hotplug.service | 13 +++++++++++++ src/systemd/vyos-net-name-resolve.service | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/systemd/vyos-net-name-resolve-hotplug.service (limited to 'src/systemd') diff --git a/src/systemd/vyos-net-name-resolve-hotplug.service b/src/systemd/vyos-net-name-resolve-hotplug.service new file mode 100644 index 000000000..c798feb99 --- /dev/null +++ b/src/systemd/vyos-net-name-resolve-hotplug.service @@ -0,0 +1,13 @@ +[Unit] +Description=VyOS persistent interface naming for hot-plugged hardware + +# Pulled in by 60-vyos-net-hotplug.rules when a network device appears. +# Held off until the boot-time configuration has been applied, otherwise the +# boot storm of "add" events would each queue a redundant run. +ConditionPathExists=/tmp/vyos-config-status + +[Service] +Type=oneshot +ExecStart=/usr/libexec/vyos/system/vyos-net-name-resolve.py +TimeoutStartSec=90 +StandardOutput=journal diff --git a/src/systemd/vyos-net-name-resolve.service b/src/systemd/vyos-net-name-resolve.service index c3563dd84..b02d22cf7 100644 --- a/src/systemd/vyos-net-name-resolve.service +++ b/src/systemd/vyos-net-name-resolve.service @@ -4,12 +4,12 @@ Documentation=man:vyos-net-name-resolve.py(8) # Started by vyos-router once the config directory is mounted - for an # encrypted volume that is only after it has been unlocked - so this can not -# be ordered independently. +# be ordered independently. Started again for hot-plugged hardware, hence no +# RemainAfterExit, which would make every later start a no-op. DefaultDependencies=no [Service] Type=oneshot -RemainAfterExit=yes ExecStart=/usr/libexec/vyos/system/vyos-net-name-resolve.py TimeoutStartSec=90 StandardOutput=journal+console -- cgit v1.2.3