[Bug 1669564] Re: udevadm trigger subsystem-match=net doesn't always run rules
Ryan Harper
1669564 at bugs.launchpad.net
Wed Mar 8 15:14:01 UTC 2017
On Wed, Mar 8, 2017 at 5:03 AM, Dimitri John Ledkov <launchpad at surgut.co.uk>
wrote:
> I wonder if following should be done (in netplan code that does the re-
> trigger, or outside after .link files modified):
>
> $ sync
> $ udevadm control --reload
> $ udevadm trigger --verbose --subsystem-match=net --action=add
>
> This is a hypothesis, to try out first to reproduce the original bug,
> and then see if extra reload helps udevd to re-read .link files.
>
I suspect there's something in the subsystem trigger which does not
replay add events on devices (for some reason unknown).
A more focused path is:
udevadm trigger --verbose --action=add /sys/class/net/$iface
Which also fails to get .link files read.
I'm working writing steps for a recreate; but in the mean time I tested this
in a zesty container:
root at z2:~# cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
eth0:
dhcp4: true
mtu: 1492
match:
macaddress: '00:16:3e:67:2b:8f'
eth1:
addresses:
- 192.168.23.2/14
mtu: 9000
match:
macaddress: '00:16:3e:b9:7b:7a'
root at z2:~# cat /run/systemd/network/10-netplan-eth0.link
[Match]
MACAddress=00:16:3e:67:2b:8f
[Link]
WakeOnLan=off
MTUBytes=1492
root at z2:~# ifconfig eth0 mtu 4800
root at z2:~# cat /sys/class/net/eth0/mtu
4800
root at z2:~# udevadm control --reload
root at z2:~# cat /sys/class/net/eth0/mtu
4800
root at z2:~# udevadm trigger --verbose --subsystem-match=net --action=add
/sys/devices/virtual/net/eth0
/sys/devices/virtual/net/eth1
/sys/devices/virtual/net/lo
root at z2:~# cat /sys/class/net/eth0/mtu
4800
root at z2:~# udevadm test-builtin net_setup_link /sys/class/net/eth0
calling: test-builtin
=== trie on-disk ===
tool version: 232
file size: 8441068 bytes
header size 80 bytes
strings 1846908 bytes
nodes 6594080 bytes
Load module index
Found container virtualization lxc
timestamp of '/etc/systemd/network' changed
timestamp of '/run/systemd/network' changed
Parsed configuration file /lib/systemd/network/99-default.link
Parsed configuration file /run/systemd/network/10-netplan-eth1.link
Parsed configuration file /run/systemd/network/10-netplan-eth0.link
Created link configuration context.
ID_NET_DRIVER=veth
Assertion 'udev_device' failed at ../src/libudev/libudev-device.c:128,
function udev_device_get_driver(). Ignoring.
Config file /run/systemd/network/10-netplan-eth0.link applies to device eth0
Could not set WakeOnLan of eth0 to off: Operation not supported
ID_NET_LINK_FILE=/run/systemd/network/10-netplan-eth0.link
Unload module index
Unloaded link configuration context.
root at z2:~# cat /sys/class/net/eth0/mtu
1492
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1669564
>
> Title:
> udevadm trigger subsystem-match=net doesn't always run rules
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/
> 1669564/+subscriptions
>
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1669564
Title:
udevadm trigger subsystem-match=net doesn't always run rules
Status in systemd package in Ubuntu:
Incomplete
Bug description:
1. root at ubuntu:~# lsb_release -rd
Description: Ubuntu Zesty Zapus (development branch)
Release: 17.04
2. root at ubuntu:~# apt-cache policy udev
udev:
Installed: 232-18ubuntu1
Candidate: 232-18ubuntu1
Version table:
*** 232-18ubuntu1 500
500 http://archive.ubuntu.com/ubuntu zesty/main amd64 Packages
100 /var/lib/dpkg/status
3. udevadm trigger --verbose --subsystem-match=net --action=add will run and read .link files from /run/systemd/network/10-netplan-interface1.link
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/net/interface1; this also will
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/network/10-netplan-interface1.link']:
Mar 02 19:17:19.839797 ubuntu cloud-init[647]: WARK: ['cat', '/run/systemd/network/10-netplan-interface1.link']:
Mar 02 19:17:19.839797 ubuntu cloud-init[647]: WARK: ['systemctl', 'start', '--no-block', 'systemd-udev-trigger.service']:
Mar 02 19:17:19.839797 ubuntu cloud-init[647]: WARK: ['udevadm', 'trigger', '--verbose', '--subsystem-match=net', '--action=add']:
root at ubuntu:~# cat /run/systemd/network/10-netplan-interface1.link
[Match]
MACAddress=52:54:00:12:34:02
[Link]
Name=interface1
WakeOnLan=off
MTUBytes=1492
root at ubuntu:~# ifconfig interface1
interface1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.100 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::5054:ff:fe12:3402 prefixlen 64 scopeid 0x20<link>
inet6 fec0::5054:ff:fe12:3402 prefixlen 64 scopeid 0x40<site>
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 at ubuntu:~# udevadm trigger --verbose --subsystem-match=net --action=add
/sys/devices/pci0000:00/0000:00:04.0/virtio1/net/interface1
/sys/devices/pci0000:00/0000:00:05.0/virtio2/net/interface2
ys/devices/pci0000:00/0000:00:06.0/virtio3/net/interface0
/sys/devices/virtual/net/lo
root at ubuntu:~# ifconfig interface1
interface1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1492
inet 10.0.2.100 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::5054:ff:fe12:3402 prefixlen 64 scopeid 0x20<link>
inet6 fec0::5054:ff:fe12:3402 prefixlen 64 scopeid 0x40<site>
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
ProcVersionSignature: Ubuntu 4.10.0-8.10-generic 4.10.0-rc8
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_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.10.0-8-generic root=UUID=8bbb84fe-91e8-4a9a-bd91-f6af4793727e ro console=ttyS0
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.version: pc-i440fx-zesty
dmi.modalias: dmi:bvnSeaBIOS:bvr1.10.1-1ubuntu1:bd04/01/2014:svnQEMU:pnStandardPC(i440FX+PIIX,1996):pvrpc-i440fx-zesty:cvnQEMU:ct1:cvrpc-i440fx-zesty:
dmi.product.name: Standard PC (i440FX + PIIX, 1996)
dmi.product.version: pc-i440fx-zesty
dmi.sys.vendor: QEMU
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1669564/+subscriptions
More information about the foundations-bugs
mailing list