Tuesday, January 4, 2011

Digiboard Port Server changes tty device permissions

Linux,Unix,Serial,Modems-Terminals,Hardware

2010/11/24

Dumb terminals haven't quite disappeared from the earth yet. I still have customers using these, though today they are almost always connected over TCP/IP using something like Digiboard Portservers.

Earlier this week, one of those customers called with a problem of changing perms on his /dev/tty* devices. He needs them set with write permission (666), but some were seemingly randomly resetting to 600.

My first thought was that perhaps the users themselves were doing this with "mesg":

 $ who am i pcunix   pts/0        2010-11-22 21:17 (209.237.150.152) $ ls -l /dev/pts/0 crw--w---- 1 pcunix tty 136, 0 Nov 22 21:18 /dev/pts/0 $ mesg n $ ls -l /dev/pts/0 crw------- 1 pcunix tty 136, 0 Nov 22 21:18 /dev/pts/0 $ mesg y $ ls -l /dev/pts/0 crw--w---- 1 pcunix tty 136, 0 Nov 22 21:19 /dev/pts/0 

That wasn't it, though. For one thing, "mesg" never appeared in any users history, and - more importantly - all the ttys on a specific Digi Portserver would change (for example, all /dev/ttyz* devices would be affected).

A bit of retrospection and log digging made the customer think that this happened whenever there was a power interruption at the store where the Portserver affected was intalled. A quick test confirmed that: lose power and the Digis lose their perms.

That had to be something to do with Digi itself. Digi has a file "/etc/udev/rules.d/10-dgrp.rules" that can specify device perms with a MODE command (MODE="0666") but that didn't seem to work.

I sent him to Digi support at that point and they provided the answer. Apparently you need to add OPTIONS="last_rule" in addition to the MODE setting. The line ends up looking something like this:

 KERNEL=="tty_dgrp*", PROGRAM="/usr/bin/dgrp_udev %k", NAME="%c,  GROUP="lp", MODE="0666", OPTIONS="last_rule" 

That fixed it.

Comments: Click Here.

Want to showcase your product to our audience? Check our advertising options.



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them.

I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. If you have any question, please do feel free to contact me.


Source: http://feedproxy.google.com/~r/aplawrence/DOLL/~3/XmV4E--QLZs/digi_port_perms.html

colt brennan accident cell phone eva longoria ipad iphone

No comments:

Post a Comment