[systemd-devel] udev rules environment variable

Andrey Borzenkov arvidjaar at gmail.com
Tue Dec 17 11:14:12 PST 2013


В Tue, 17 Dec 2013 19:59:47 +0100
Kay Sievers <kay at vrfy.org> пишет:

> 
> Works just fine here as expected, it's probably something in your setup.
> 

No, it *your* default interface renaming :)

> Kay
> 
> # head -2 /etc/udev/rules.d/10-local.rules
> ACTION=="add", SUBSYSTEM=="net", ENV{test_device}="1"
> ACTION=="remove", SUBSYSTEM=="net", ENV{test_device}=="1",
> RUN+="/bin/logger $env{test_device}"
> 
> # udevadm monitor -p -u &
> 
> # modprobe dummy

dummy is not renamed.

KERNEL[80247.266050] add      /devices/pci0000:00/0000:00:03.0/net/eth0 (net)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:03.0/net/eth0
IFINDEX=8
INTERFACE=eth0
SEQNUM=1448
SUBSYSTEM=net

KERNEL[80247.295702] move     /devices/pci0000:00/0000:00:03.0/net/ens3 (net)
ACTION=move
DEVPATH=/devices/pci0000:00/0000:00:03.0/net/ens3
DEVPATH_OLD=/devices/pci0000:00/0000:00:03.0/net/eth0
IFINDEX=8
INTERFACE=ens3
SEQNUM=1452
SUBSYSTEM=net

UDEV  [80256.247824] add      /devices/pci0000:00/0000:00:03.0/net/ens3 (net)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:03.0/net/ens3
ID_BUS=pci
...
INTERFACE=ens3
INTERFACE_OLD=eth0
SEQNUM=1448
...
test_device=1

UDEV  [80256.274447] move     /devices/pci0000:00/0000:00:03.0/net/ens3 (net)
ACTION=move
...
INTERFACE=ens3
SEQNUM=1452
...
TAGS=:systemd:
UDEV_LOG=7

Oops. test_device is lost. 


More information about the systemd-devel mailing list