[systemd-devel] udev-rules not applied to device

Mantas Mikulėnas grawity at gmail.com
Thu Mar 27 01:25:26 PDT 2014


On Mar 27, 2014 8:48 AM, "Satz Klauer" <satzklauer at googlemail.com> wrote:
>
> So...hopefully this is really the udev mailing list...
>
> I use CentoOS 6.5, an embedded device that is connected via USB and
> shows up as /dev/ttyACMx (in my case it is always /dev/ttyACM0). To
> have it read/writable for everybody and to avoid the modem-manager is
> accessing it I created following rule in
> /etc/udev/rules.d/52-mydev.rules:
>
> SUBSYSTEM=="usb", ATTR{idVendor}=="1781", ATTR{idProduct}=="1ef0",
> MODE="0666", GROUP="plugdev", ENV{ID_MM_DEVICE_IGNORE}="1"
>
> Unfortunately they are not working as expected, /dev/ttyACM0 is still
> not world-read/writable and the modem-manager still comes in between.
>
> What I found meanwhile using udev-debug-output: the rule is used and
> applied, at least for the mode 0666. But udev sets the permissions to
> the USB endpoint path (something with /bus/usb/...) but not to the
> device.
>
> So: how can I let udev change the permission of the device? And whyt
> could be the reason why modem-manager still tries to use it?
>
> Any ideas and suggestions are welcome!

udev sets permissions on the USB endpoint because that's what your rule
matches – you have SUBSYSTEM="usb", you match against USB sysfs attributes,
etc.

The actual tty device node most likely has "tty" as subsystem – use
`udevadm info /dev/ttyACM0` to see the subsystem and the ENV{} variables
that you can match against, and let the rule check also attrs of _parent_
devices using ATTRS{} instead of ATTR{} (if these matches are necessary in
the end; I think env matches will be simpler).

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


More information about the systemd-devel mailing list