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 08:25, pgnd (pgnd@xxxxxxxxxxxx) wrote:

> > "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.
>
>
> useful, thx.
>
> but still, with
>
> 	edit /etc/udev/rules.d/99-test.rules
> -		ACTION=="add|bind|change", SUBSYSTEM=="net", KERNEL=="enp5s0", RUN+="/bin/touch /etc/test-touch.txt"
> +		ACTION!="remove", SUBSYSTEM=="net", KERNEL=="enp5s0", RUN+="/bin/touch /etc/test-touch.txt"
>
> after boot, nothing done
>
> 	ls -al /etc/test-touch.txt
> 		(empty)

You do realize that /etc/ is generally not transferred from the initrd
to the host? If you look into /etc/ from the host, then no files you
created there from the initrd will exist.

Lennart

--
Lennart Poettering, Berlin



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

  Powered by Linux