LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-18-2006, 10:34 AM   #1
alexandre_fs
LQ Newbie
 
Registered: Oct 2006
Distribution: kubuntu 6.06
Posts: 18

Rep: Reputation: 0
change file permission of a mouse device file permanently


hello.

i am developping an application that needs to poll/read the device file: /dev/input/mouse0

i belong to a group that has no permission to read this file, so i use the following command:

sudo chgrp alexandre /dev/input/mouse0

(alexandre is the group that i belong...)

now, the problem is that when i restart the computer, or disconnect and reconnect again the mouse, it resets the permissions to default.

how can i permanently change the access permission to this kind of device files?

i am using kubuntu 6.06 with the latest kernel.

also, i checked for udev and devfs and they both seemed to be installed. (at least there are configuration files in /etc/udev and /etc/devfs

i am guessing i could change the permission rules in udev, but i can't find where it refers to mouse devices.

thank you for your attention,

Alexandre
 
Old 12-18-2006, 11:34 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
You could add the mouse group as a secondary user group to your user account.

usermod -G mouse,video,disk,whatever alexandre

Or you could use the udev startup script to establish device permissions for the mouse device during system startup.

Last edited by stress_junkie; 12-18-2006 at 11:39 AM.
 
Old 12-20-2006, 07:33 AM   #3
alexandre_fs
LQ Newbie
 
Registered: Oct 2006
Distribution: kubuntu 6.06
Posts: 18

Original Poster
Rep: Reputation: 0
thanks for your answer.

maybe it's better to modify the udev script, since the group that has permission to read the device files is by default only 'root'.

i've been checking some sites for doing this and i can't find a simple guide to just change this simple aspect. (make the mouse devices files readable to every user...)

i'm guessing that this should be quite direct. can you give me a hint on how to do this?


thank you
 
Old 12-20-2006, 08:20 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
With udev, it should be something like this:

edit /etc/udev/permissions.rules and go to input devices, modify the line containing KERNEL=="mouse[0-9]*"
If it doesn't exist, add it :

Quote:
KERNEL=="mouse[0-9]*", MODE="0664"
Do not put it after LABEL="permissions_end"

And you need to reboot
 
Old 12-25-2006, 02:50 PM   #5
alexandre_fs
LQ Newbie
 
Registered: Oct 2006
Distribution: kubuntu 6.06
Posts: 18

Original Poster
Rep: Reputation: 0
ok thanks nx5000

i will give it a try and post here the result, as soon as possible.

alexandre
 
Old 01-09-2007, 06:30 AM   #6
alexandre_fs
LQ Newbie
 
Registered: Oct 2006
Distribution: kubuntu 6.06
Posts: 18

Original Poster
Rep: Reputation: 0
i edited the file 40-permission.rules like u suggested, and added that line.
i could not find any LABEL saying "permissions_end" so i inserted in the end of the file.

everything is OK now
i can now read mouse device files by default.

thank you for your help!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem changing a file permission permanently alexandre_fs Linux - Newbie 2 11-20-2006 09:22 AM
mass file permission change help mattd7591 Linux - Security 4 07-31-2006 10:03 AM
how to change the file permission ?? AK prince Slackware 17 08-05-2005 12:16 PM
Cannot Change File Permission dsuratman Linux - Newbie 12 11-03-2003 01:47 PM
cp command change the file permission? myunicom Linux - General 6 09-24-2003 08:15 AM


All times are GMT -5. The time now is 04:59 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration