Re: udev rules in /etc/udev/rules.d/ ignored/not-loaded on boot; exec manually OK at shell ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fr, 22.12.23 07:34, pgnd (pgnd@xxxxxxxxxxxx) wrote:

> > ANY valid rule I add -- there -- fails to be read / loaded ...
>
> e.g.,
>
> cat /etc/udev/rules.d/99-test.rules
> 	ACTION=="add|bind|change", SUBSYSTEM=="net", KERNEL=="enp5s0", RUN+="/bin/touch /etc/test-touch.txt"

"enp5s0" is a predictable name how systemd/udev configures them, not
the kernel. When a netif is renamed then this results in a "move"
event, not "add" or "bind" or "change".

Generally, in the vast majority of cases rules should be written with
either a check of ACTION!="remove" or ACTION=="remove" depending on
whether they should apply if the device is there, or when it goes
away. The important part here is: don't list the many positive
actions, but instead only specify the single negative action
(i.e. "remove"). That's both more robust and safer for future actions
to be added.

Lennart

--
Lennart Poettering, Berlin



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux