[systemd-devel] Which udev action is run on boot for my device?

Andrei Borzenkov arvidjaar at gmail.com
Sun Oct 25 17:48:50 UTC 2020


25.10.2020 20:36, Marcin Kocur пишет:
> Hello,
> 
> as the topic states, I want to know which action(s) from "add",
> "remove", "change", "move", "online", "offline", "bind", and "unbind"
> were triggered on my device. Is there any way to check that?
> 
> At the beginning of  /usr/lib/udev/rules.d/49-sane.rules there is:
> 
> ACTION!="add", GOTO="libsane_rules_end"
> 
> Udevadm info doesn't show libsane_matched property for my scanner.
> 
> If I trigger the device manually with action "change", the variable is
> still not there, as per the rule.
> 
> But if I trigger it with "add", the variable is there and also uaccess
> rule gets executed.
> 
> So the ultimate quesiton is: what kind of trigger was executed on my
> device on boot time?
> 

When device is detected by kernel it emits ADD event. This may happen in
initrd where not all rules are available. Later traditionally equivalent
of "udevadm trigger" was executed; in current upstream systemd sources
this invokes

ExecStart=udevadm trigger --type=subsystems --action=add
ExecStart=udevadm trigger --type=devices --action=add


Your distribution is free to not perform udevadm trigger or to modify
service to call it with different parameters. So it is something that
cannot be answered upstream.


More information about the systemd-devel mailing list