[systemd-devel] [udev] Limitation of capturing remove events?

Mantas Mikulėnas grawity at gmail.com
Mon Aug 31 22:14:13 PDT 2015


On Tue, Sep 1, 2015 at 6:32 AM, Tom Yan <tom.ty89 at gmail.com> wrote:

> Is it a limitation or bug that I can only capture remove events with
> purely SUBSYSTEM or KENREL match, but not with ATTR{*} or even DRIVER?
>

AFAIK, the former two come from the uevent itself, but the latter are
always read from sysfs... and during a remove event, the device is not in
sysfs anymore.

(Even more, some sysfs attributes might themselves query data directly from
the device, which wouldn't work well if the device is no longer connected.)

So IMHO you should match on udev's ENV{} instead, and cache the desired
attributes into ENV.

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150901/87c7319e/attachment-0001.html>


More information about the systemd-devel mailing list