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 (184.108.40.206) $ 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.
If you found something useful today, please consider a small donation.
Got something to add? Send me email.
More Articles by Anthony Lawrence © 2010-11-24 Anthony Lawrence