diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-10-07 19:56:42 +0200 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-10-31 09:58:29 +0000 |
| commit | c95aae771d74e11bedc095e92e4c38ce7d25fa59 (patch) | |
| tree | fff2e28aacf64be21c60f632b880381c7e7fd38c /src/systemd | |
| parent | 9d24bffcc47b48396c580a48ec9405411e955342 (diff) | |
| download | vyos-1x-c95aae771d74e11bedc095e92e4c38ce7d25fa59.tar.gz vyos-1x-c95aae771d74e11bedc095e92e4c38ce7d25fa59.zip | |
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.
Diffstat (limited to 'src/systemd')
| -rw-r--r-- | src/systemd/vyos-net-name-resolve-hotplug.service | 13 | ||||
| -rw-r--r-- | src/systemd/vyos-net-name-resolve.service | 4 |
2 files changed, 15 insertions, 2 deletions
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 |
