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

Lennart Poettering lennart at poettering.net
Mon Oct 26 10:15:05 UTC 2020


On So, 25.10.20 18:36, Marcin Kocur (marcin2006 at gmail.com) wrote:

> 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"

That's a poort choice typically. People should use ACTION=="remove"
checks for this instead. I.e. there's exactly one "negative" action
type, and that's "remove". All others should be considered "positive",
as the device is still around when they happen.

> 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.

Yeah, the rule is broken. udev rules should be written in a style that
a "change" event can be triggered any time, and the devices keep their
properties. Writing rules that only set props on "add" are simply
broken. They set all props on any event but "remove", see above.

Please report to the upstream of the package in question.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list