0

I need to get some USB-serial devices into a particular user group to access them from an application. This is straightforward for the /dev/ttyUSB devices, where I can just use KERNEL="ttyUSB*", GROUP:="mygroup". However, for the symlinks like /dev/bus/usb/001/001, it is not obvious how to accomplish the same thing of setting their group to mygroup. I can do it by editing the default rules file /etc/udev/rules.d/50-udev.rules and adding a GROUP="mygroup" clause to the line for usb_device which creates the symlinks in /dev/bus/usb, however editing this file is clearly suboptimal from a packaging point of view.

So: how can I write a udev rule to modify the ownership of a symlink created by an earlier, default udev rule?

(I'm working on CentOS 5.5.)

kdt
  • 1,360
  • 3
  • 22
  • 34

3 Answers3

2

Answered my own question: apparently it's all about using := instead of =.

SUBSYSTEM=="usb_device", MODE:="0664", GROUP:="mygroup"

This goes in a 10-usb-devices.rules file in /etc/udev/rules.d. The ":=" gets it to override the permissions of the nodes that the other rule creates -- I had initially incorrectly thought it was creating symlinks when in fact it was creating actual nodes in /dev/bus.

kdt
  • 1,360
  • 3
  • 22
  • 34
0

I was confronted to your problem 2 years ago (centos 4) and the only solution I've found was also to modify the udev rules. But I've created a specific file for it. Have you tried to create a 49-mydev.rules with your specific device ?

Rosco
  • 455
  • 3
  • 6
-1

Symbolic link ownership shouldn't matter, only the ownership of the file that the link points to.

Cry Havok
  • 1,825
  • 13
  • 10