Permenantly setting permissions for /dev/ttyUSB*

Issues related to hardware problems

Permenantly setting permissions for /dev/ttyUSB*

Postby nikkilocke » 2012/01/30 12:18:37

I wish to give ordinary users read/write access to /dev/ttyUSB* (so till software at a shop can control the till roll printer and open the till drawer).

It seems every release of CentOs changes how this should be done!
In CentOs 5, I edited /etc/udev/rules.d/50-udev.rules. I understand in CentOs 6 the rules are now in /lib/udev/rules.d, but I can't find any reference to ttyUSB in that folder, other than:

60-persistent-serial.rules(5): KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="persistent_serial_end"

Where should I add a rule to do the equivalent of the CentOs 5 line:

/etc/udev/rules.d/50-udev.rules:KERNEL=="ttyUSB*", GROUP="epos", MODE="0666"

(and what shoulld the rule say)
nikkilocke
 
Posts: 96
Joined: 2006/03/28 15:59:00

Re: Permenantly setting permissions for /dev/ttyUSB*

Postby TrevorH » 2012/01/30 12:26:31

What does `ls -la /dev/ttyUSB*` say with the standard udev rules in place?
User avatar
TrevorH
Forum Moderator
 
Posts: 9168
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Permenantly setting permissions for /dev/ttyUSB*

Postby nikkilocke » 2012/01/30 13:43:04

This was more of an exploratory question - I am testing and debugging my install scripts on a VM, and I don't think I can attach the actual USB hardware to the VM (I don't have drivers for the host O/S).

However, I am burning a real CentOs 6 DVD as we speak, preparatory to installing it on a real box, so I'll let you know.

In the mean time, a pointer to documentation on how the CentOs 6 rules work would be nice?
nikkilocke
 
Posts: 96
Joined: 2006/03/28 15:59:00

Re: Permenantly setting permissions for /dev/ttyUSB*

Postby nikkilocke » 2012/01/30 17:06:07

Turns out I won't be able to answer your question for a while - CentOs 6 won't install on the old target hardware I have to hand (no pae or cx8, so I have to wait for the client to decide on and procure the new target hardware before I can actually check out the printer hardware.

So an answer based on theory, rather than practice, would be nice!
nikkilocke
 
Posts: 96
Joined: 2006/03/28 15:59:00

Re: Permenantly setting permissions for /dev/ttyUSB*

Postby pschaff » 2012/01/31 10:12:29

nikkilocke wrote:
This was more of an exploratory question - I am testing and debugging my install scripts on a VM, and I don't think I can attach the actual USB hardware to the VM (I don't have drivers for the host O/S).

Perhaps not relevant to CentOS, but it is a rare host OS that does not have native USB drivers. Many virtualization methods allow USB passthrough.

In the mean time, a pointer to documentation on how the CentOs 6 rules work would be nice?


How about some help from a google on "/etc/udev/rules.d/" "/lib/udev/rules.d/" site:redhat.com?

First, according to upstream:
"/lib/udev/rules.d is for operating system provided rules that shouldn't be edited. /etc/udev/rules.d is for system-specific configuration"

For details see the upstream docs.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: Permenantly setting permissions for /dev/ttyUSB*

Postby nikkilocke » 2012/01/31 15:01:03

Thanks for the pointer to the upstream docs. Is there no corresponding doc website for CentOs? (It might work a bit better - the search results page in the RedHat one is a total mess when viewed with Chrome.)

I have read that page, and the adjoining ones (which seem to be about Logical Volumne Management, which, AFAIK, is something to do with disks. I have copied the sample rules file from .usr/share/docs/device-mapper* into /lib/udev/rules.d

I am still totally baffled as to how to write a rule which will match /dev/ttyUSB*, and set the ownership and permissions.

What is a "DM device"?

Do I put in a rule like:

KERNEL=="ttyUSB*", GROUP="epos", MODE="0666"

or do the rules in this file have to begin with "ENV{DM"

Are the rules executed in filename alphanumeric order? If so, what happens if 2 rules match the same device?

Will the rule at the start of this file
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end"

cause any rules I add later to be skipped?

Am I even using the right file?

Am I alone in wanting to read some documentation which tells me what to do, instead of fiddling about to find out what works?

Sorry, I'm getting carried away now :-)
nikkilocke
 
Posts: 96
Joined: 2006/03/28 15:59:00

Re: Permenantly setting permissions for /dev/ttyUSB*

Postby pschaff » 2012/01/31 22:57:33

CentOS has yet to get their act together with hosting the EL6 documentation. Sorry I can't answer your questions without research, and no time now.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: Permenantly setting permissions for /dev/ttyUSB*

Postby nikkilocke » 2012/02/01 10:06:04

Thanks for the help you have given, I appreciate it.

I guess I will wait until I have the target hardware, and fiddle about until I get something that works.

I hate that, but I suppose I'm using a free operating system, and shouldn't complain!
nikkilocke
 
Posts: 96
Joined: 2006/03/28 15:59:00

Permenantly setting permissions for /dev/ttyUSB*

Postby gerald_clark » 2012/02/01 14:27:24

You still have not answered the question in post #2.
You might need to add your users to the terminal's group.
gerald_clark
 
Posts: 7183
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Permenantly setting permissions for /dev/ttyUSB*

Postby nikkilocke » 2012/02/01 14:32:45

Do you mean the question asked by TrevorH?

If so, I answered as best I could in posts #3 and #4 - I am not in a position to run the command you suggest, because I am unable to install CentOs on the hardware I have here, and I am unable to attach the relevant device to the VM I am testing in.

I will have to wait until I have CentOs installed on hardware to which I can attach the printer before I can proceed further.
nikkilocke
 
Posts: 96
Joined: 2006/03/28 15:59:00

Next

Return to CentOS 6 - Hardware Support

Who is online

Users browsing this forum: No registered users and 6 guests