[systemd-devel] udev rules environment variable
Robert Milasan
rmilasan at suse.com
Wed Dec 18 04:36:52 PST 2013
On Tue, 17 Dec 2013 23:14:12 +0400
"Andrey Borzenkov" <arvidjaar at gmail.com> wrote:
> В 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.
>
So basically it doesn't really work ?!
--
Robert Milasan
L3 Support Engineer
SUSE Linux (http://www.suse.com)
email: rmilasan at suse.com
GPG fingerprint: B6FE F4A8 0FA3 3040 3402 6FE7 2F64 167C 1909 6D1A
More information about the systemd-devel
mailing list