udevadm trigger subsystem-match=net doesn't always run rules because of reconfiguration rate-limiting
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nplan (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Zesty |
Fix Released
|
Undecided
|
Unassigned | ||
Artful |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Proper udev trigger behavior following a 'netplan apply' is essential to having all the configuration applied for an interface.
[Test case]
1- Write a netplan configuration file that sets MTU for a device, or renames a device.
2- Run 'netplan apply'
Validate that all the changes were correctly applied: netplan apply will run 'udevadm trigger' for the user, and udev should apply all low-level link changes (MTU and renames).
Make sure to watch out for device renames on devices that are blacklisted for replugging such as mwifiex, XEN VIF, etc.
[Regression potential]
Verification should watch out for a MTU being set, but set to the wrong value, or MTUs being applied to all interfaces rather than just the interface for which it was set. Users should also watch out for the network device to be renamed correctly, and then seen as the correct name and state in both networkd and the ip command.
---
1. root@ubuntu:~# lsb_release -rd
Description: Ubuntu Zesty Zapus (development branch)
Release: 17.04
2. root@ubuntu:~# apt-cache policy udev
udev:
Installed: 232-18ubuntu1
Candidate: 232-18ubuntu1
Version table:
*** 232-18ubuntu1 500
500 http://
100 /var/lib/
3. udevadm trigger --verbose --subsystem-
and apply MTU settings
4. during system boot running (3) does not set the MTU; running (3) after boot has completed MTU is set correctly.
Here'a log during boot where cloud-init generates a netplan config,
invokes `netplan generate` which writes the networkd config out
and then udevadm trigger (3). Upon logging in interface1 has an MTU of 1500. Re-running udevadm trigger now runs the rules/link files and updates the MTU.
Note that, if you run udevadm test /sys/class/
apply the MTU (test probably shouldn't change the interface, I'll file a
bug for that as well).
# journalctl -o short-precise --no-pager -b | grep WARK
Mar 02 19:17:19.839797 ubuntu cloud-init[647]: WARK: ['netplan', '--debug', 'generate']:
Mar 02 19:17:19.839797 ubuntu cloud-init[647]: WARK: ['stat', '/run/systemd/
Mar 02 19:17:19.839797 ubuntu cloud-init[647]: WARK: ['cat', '/run/systemd/
Mar 02 19:17:19.839797 ubuntu cloud-init[647]: WARK: ['systemctl', 'start', '--no-block', 'systemd-
Mar 02 19:17:19.839797 ubuntu cloud-init[647]: WARK: ['udevadm', 'trigger', '--verbose', '--subsystem-
root@ubuntu:~# cat /run/systemd/
[Match]
MACAddress=
[Link]
Name=interface1
WakeOnLan=off
MTUBytes=1492
root@ubuntu:~# ifconfig interface1
interface1: flags=4163<
inet 10.0.2.100 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::5054:
inet6 fec0::5054:
ether 52:54:00:12:34:02 txqueuelen 1000 (Ethernet)
RX packets 16 bytes 5053 (5.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 35 bytes 3287 (3.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@ubuntu:~# udevadm trigger --verbose --subsystem-
/sys/devices/
/sys/devices/
ys/devices/
/sys/devices/
root@ubuntu:~# ifconfig interface1
interface1: flags=4163<
inet 10.0.2.100 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::5054:
inet6 fec0::5054:
ether 52:54:00:12:34:02 txqueuelen 1000 (Ethernet)
RX packets 16 bytes 5053 (5.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 37 bytes 3504 (3.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: udev 232-18ubuntu1
ProcVersionSign
Uname: Linux 4.10.0-8-generic x86_64
ApportVersion: 2.20.4-0ubuntu2
Architecture: amd64
Date: Thu Mar 2 19:22:14 2017
Lsusb: Error: command ['lsusb'] failed with exit code 1:
MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
ProcEnviron:
TERM=vt220
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/01/2014
dmi.bios.vendor: SeaBIOS
dmi.bios.version: 1.10.1-1ubuntu1
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.
dmi.modalias: dmi:bvnSeaBIOS:
dmi.product.name: Standard PC (i440FX + PIIX, 1996)
dmi.product.
dmi.sys.vendor: QEMU
Related branches
- Steve Langasek: Approve
- Mathieu Trudel-Lapierre: Pending requested
- Developers of netplan: Pending requested
-
Diff: 47 lines (+21/-0)2 files modifieddebian/changelog (+7/-0)
src/generate.c (+14/-0)
description: | updated |
description: | updated |
tags: | added: rls-z-incoming |
tags: |
added: rls-aa-incoming removed: rls-z-incoming |
summary: |
- udevadm trigger subsystem-match=net doesn't always run rules + udevadm trigger subsystem-match=net doesn't always run rules because of + reconfiguration rate-limiting |
Changed in systemd (Ubuntu): | |
importance: | Undecided → High |
tags: | removed: rls-aa-incoming |
Changed in systemd (Ubuntu Artful): | |
assignee: | nobody → Balint Reczey (rbalint) |
tags: | added: id-597a09900a9f730ee1bfade0 |
Changed in systemd (Ubuntu): | |
status: | Incomplete → Invalid |
Changed in nplan (Ubuntu): | |
status: | New → Triaged |
no longer affects: | systemd (Ubuntu) |
no longer affects: | systemd (Ubuntu Xenial) |
no longer affects: | systemd (Ubuntu Zesty) |
no longer affects: | systemd (Ubuntu Artful) |
no longer affects: | systemd (Ubuntu Bb-series) |
description: | updated |
description: | updated |
Should one not restart systemd-networkd after writing out .link et.al. units?