Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have added a udev rule for my Arduino, but the symlink gets the ownership "root root" instead of "root dialout".

$ cat /etc/udev/rules.d/47-Arduino.rules 
SUBSYSTEM=="usb", ATTR{idVendor}=="2341", ATTR{idProduct}=="0001", MODE="0666", SYMLINK+="arduino", GROUP="dialout"

$ ls -la /dev/ar*
lrwxrwxrwx 1 root root 15 sep  8 11:02 /dev/arduino -> bus/usb/003/007

$ ls -la /dev/bus/usb/003/007 
crw-rw-r-- 1 root dialout 189, 262 sep  8 11:12 /dev/bus/usb/003/007

My user is a member of the group "dialout" but I still get permission denied error when I'm trying to communicate with the device.

There are no problems when I'm using the "default" device "/etc/ttyACM3".

$ ls -la /dev/ttyACM3 
crw-rw---- 1 root dialout 166, 3 sep  8 11:12 /dev/ttyACM3

I have tried to restart both the udev service and reboot my computer. How can I fix this?

share|improve this question

1 Answer 1

I'm not sure there is a way to set the user and group for a symlink with udev. I don't see one either. I'm also doubting whether one should be needed.

I signed on to tty6 and as root, created a symbolic link/tmp/tty6 to /dev/tty6. After I did its user and group were both root, but /dev/tty6 was owned by me.

I was able to use

echo hi >/dev/tty6

but also echo hi >/tmp/tty6

The reason is that the necessary permission is carried by the final inode pointed to, not the symbolic link.

If I'm right, there is another reason for the problem you are having, although I guess it could be that the program you are using does, incorrectly, look at the permissions on the symbolic link.

If that's the case, as a circumvention, perhaps you could create your own link and use that instead of one udev sets.

ln -s /dev/arduino ~/arduino

should produce a symbolic link to the target of /dev/arduino but with your user and group.

As a test, as root, you might also change the group yourself on the udev created symbolic link and see if it helps when going through /dev/arduino.

share|improve this answer
    
Thanks for the input, the whole point with udev is to solve that the usb devices get different names different times they are connected so I cannot have a script creating those symlinks which was what I needed. I'll try to check as you said if the programs looks on the symlink ownerships and gives up without trying. Maybe I could some how have a chown script hooked up to run when the device is connected. I thinking though that this would be a common problem and should have a simpler solution... Thanks for the input anyway. –  Tirithen Sep 9 '12 at 9:02
    
I understood what you were looking for. That's why I suggested ln -s /dev/arduino ~/arduino. The link produced, ~/arduino, should have your ownership and point to the ultimate /dev/bus/usb/x/y udev made /dev/arduino point to. As you said, perhaps a udev initiated script could run this command, and it could certainly go somewhere other than in your home directory. –  John S Gruber Sep 9 '12 at 14:27
    
Ah now I understand what you mean :) thanks, I'll try that. –  Tirithen Sep 9 '12 at 20:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.