Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> udev rule configuration using uid
redman
 Posted: Jan 29 2016, 07:07 PM
Quote Post


Retired SLF Administrator
********

Group: Admins
Posts: 1276
Member No.: 2
Joined: 8-April 11









I want to create a rule configuration for an usb dj controller.
The following script is needed to make the controller work:

CODE
# Allow scanning and use of USB HID devices
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{bInterfaceClass}=="03", OWNER="redman", MODE="0660"

# Vendors with USB Bulk-transfer DJ controllers
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="06f8", OWNER="redman", MODE="0660" # Hercules


What I would like is this configuration to use uid 1000 instead of a hardcoded username.
This way, when installed on another computer, the same configuration file can be used.

But I have trouble getting it right. I tried without the owner specification and mode 0666, but nothing worked. If anyone has a clue or know the answer, please let me know.

--------------------
"Sometimes the best helping hand you can give is a good, firm push."
PM
^
inittux
 Posted: Jan 29 2016, 08:58 PM
Quote Post


SLF Geek
****

Group: Members
Posts: 304
Member No.: 953
Joined: 20-October 11









I have no experience with udev, but seems like there's only the following fields you can use concerning onwership mentioned in the man are: OWNER, GROUP, MODE. Why not use a default system group which is already on all system: users:x:100:

# Vendors with USB Bulk-transfer DJ controllers
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="06f8", GROUP="users", MODE="0660" # Hercules

Then I would think all you have to do is add the user with uid 1000 to the group users on all of the systems or which users need access to the device?

--------------------
PM
^
redman
 Posted: Jan 30 2016, 08:37 AM
Quote Post


Retired SLF Administrator
********

Group: Admins
Posts: 1276
Member No.: 2
Joined: 8-April 11









The reason I want to avoid using GROUP, is that every user on a EL7 system is only a member of its own private group:
CODE
$groups redman
redman : redman


And then still I would have to manually edit that after installation.
By using something related to UID=1000, that wouldn't be needed as all systems where I am installing this package only has one user (that automatically has UID 1000).

--------------------
"Sometimes the best helping hand you can give is a good, firm push."
PM
^
inittux
 Posted: Jan 30 2016, 10:12 AM
Quote Post


SLF Geek
****

Group: Members
Posts: 304
Member No.: 953
Joined: 20-October 11









QUOTE (redman @ Jan 30 2016, 10:37 AM)
The reason I want to avoid using GROUP, is that every user on a EL7 system is only a member of its own private group:
CODE
$groups redman
redman : redman


And then still I would have to manually edit that after installation.
By using something related to UID=1000, that wouldn't be needed as all systems where I am installing this package only has one user (that automatically has UID 1000).


Yeah that would be easier.

Did some searching, but only found one example where they used uid and guid. Have you tried to use uid to see when happens?

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="06f8", uid="1000", MODE="0660" # Hercules

But all the other examples I found they were all used with user/group. Like this one. And on a howto that seems pretty legit it isn't mention either. So that's about all the information I have found, did learn something new while trying to help you find a solution smile.gif

--------------------
PM
^
redman
 Posted: Jan 30 2016, 04:12 PM
Quote Post


Retired SLF Administrator
********

Group: Admins
Posts: 1276
Member No.: 2
Joined: 8-April 11









Thanks, but I already tried that one.
It seems I will need to manually adjust the username on the machine installed.

--------------------
"Sometimes the best helping hand you can give is a good, firm push."
PM
^
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll