Difference between revisions of "Making udev rule to set usb device permissions"

From Finninday
Jump to: navigation, search
(Created page with "I have a USB temperature probe that defaults to 600 permission and ownership by root. I'd like everyone (especially my non-root script) to be able to read this device, so I set …")
 
Line 14: Line 14:
  
 
My previous attempt at a fix for this was to add a "chmod" to /etc/rc.local, but udev is smarter than that, since it changes the permission of my usb device at times other than reboot.  We'll see if this udev rule is sufficient.  If not, I'll have to start reading more about udev.
 
My previous attempt at a fix for this was to add a "chmod" to /etc/rc.local, but udev is smarter than that, since it changes the permission of my usb device at times other than reboot.  We'll see if this udev rule is sufficient.  If not, I'll have to start reading more about udev.
 +
 +
I disabled the /etc/rc.local script and rebooted... immediately after booting, the permissions on /dev/ldusb0 were 600 again.
 +
 +
Bummer.

Revision as of 02:47, 21 December 2010

I have a USB temperature probe that defaults to 600 permission and ownership by root. I'd like everyone (especially my non-root script) to be able to read this device, so I set it to 644 permission. But something keeps switching the permission back. I assume this something is udev. To make my permission setting stick, I told udev to honor it by creating this file:

root@weasel:/etc/udev/rules.d# pwd;ls
/etc/udev/rules.d
45-libmtp7.rules	70-persistent-net.rules  README
70-persistent-cd.rules	99-vernier.rules
root@weasel:/etc/udev/rules.d# cat 99-vernier.rules 
# Vernier EasyTemp/Go!Temp
ATTR{idVendor}=="08f7", ATTR{idProduct}=="0002", MODE="644"

I guessed at the syntax by peeking at the other rules files in this directory.

My previous attempt at a fix for this was to add a "chmod" to /etc/rc.local, but udev is smarter than that, since it changes the permission of my usb device at times other than reboot. We'll see if this udev rule is sufficient. If not, I'll have to start reading more about udev.

I disabled the /etc/rc.local script and rebooted... immediately after booting, the permissions on /dev/ldusb0 were 600 again.

Bummer.