Comment 9 for bug 1669564

Revision history for this message
Ryan Harper (raharper) wrote : Re: [Bug 1669564] Re: udevadm trigger subsystem-match=net doesn't always run rules

On Wed, Mar 8, 2017 at 5:03 AM, Dimitri John Ledkov <email address hidden>
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@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@z2:~# cat /run/systemd/network/10-netplan-eth0.link
[Match]
MACAddress=00:16:3e:67:2b:8f

[Link]
WakeOnLan=off
MTUBytes=1492

root@z2:~# ifconfig eth0 mtu 4800
root@z2:~# cat /sys/class/net/eth0/mtu
4800
root@z2:~# udevadm control --reload
root@z2:~# cat /sys/class/net/eth0/mtu
4800
root@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@z2:~# cat /sys/class/net/eth0/mtu
4800
root@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@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
>