LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   ttyS0 changing group (https://www.linuxquestions.org/questions/linux-general-1/ttys0-changing-group-719663/)

emetib 04-16-2009 03:44 PM

ttyS0 changing group
 
for some reason my minicom has started messing with me.

first i can't access ttyS0 as user.
styx:/home/chad# l /dev/ttyS*
crw------- 1 root root 4, 64 2009-04-16 15:37 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 2009-04-16 14:06 /dev/ttyS1

now, i've chgrp and chmod to ttyS0 been able to run minicom as user, yet within 2 minutes, it's back to root:root. it'll switch back to root:root within 2 minutes, even if minicom hasn't been run.

i've chgrp, chmod and then rebooted, hoping to have things stay the same, yet no. it starts out with root:root right away.

any ideas?

Ramurd 04-17-2009 08:52 AM

Probably udev, take a look at your udev rules and see what group is bound to ttyS0.

malekmustaq 04-17-2009 09:05 AM

emetib:

Also try edit your user ID make it a member of additional groups:

'messagebus'
'hal-daemon' or 'hald' or 'daemon' <whatever is provided>
'tty'
'power' and
'plugdev'

If this doesn't solve the problem you can exclude them by reediting your account for security reasons you may think of.

I hope this helps. (IHTH)

Goodluck.

emetib 04-17-2009 10:41 AM

Quote:

Originally Posted by Ramurd (Post 3512196)
Probably udev, take a look at your udev rules and see what group is bound to ttyS0.

ok, check this out-
grep tty /etc/udev/rules.d/*
/etc/udev/rules.d/50-udev.rules:SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \
/etc/udev/rules.d/91-permissions.rules:SUBSYSTEM=="tty", GROUP="dialout"
/etc/udev/rules.d/91-permissions.rules:# vc devices (all members of the tty subsystem)
/etc/udev/rules.d/91-permissions.rules:KERNEL=="tty", MODE="0666", GROUP="root"
/etc/udev/rules.d/91-permissions.rules:KERNEL=="tty[0-9]*", GROUP="root"
/etc/udev/rules.d/91-permissions.rules:KERNEL=="pty*", MODE="0666", GROUP="tty"
/etc/udev/rules.d/91-permissions.rules:KERNEL=="iseries/vtty*", GROUP="dialout"
/etc/udev/rules.d/95-late.rules:KERNEL=="tty" , OPTIONS+="last_rule"
/etc/udev/rules.d/95-late.rules:KERNEL=="tty[0-9]*", OPTIONS+="last_rule"

i've done that on two other systems and the 91-permissions is always the same.

now the question that i have about that is, in 91-perms, is that there is a SUBSYSTEMS and then a KERNEL. which of them has the priority?

can i put in another line for ttyS[0-9] and have it be with the dialout group?

Ramurd 04-18-2009 04:22 AM

The priority would only apply when two rules would outrule each other, this is not the case here; but the SUBSYSTEMS one references to the KERNEL.

The issue you're having is with the 91-permissions file, and it would seem to me that you can indeed add a ttyS[0-9] MODE="0666", GROUP="dialout"; this ought to fix your problem.

emetib 04-19-2009 01:14 PM

should that be a SUBSYSTEM or a KERNEL?
i tried it as both, and did a /etc/init.d/udev restart, chgrp the ttyS0 to dialout and it still dropped back to root within 2-3 minutes.

should i do a hard reboot to make this stick?

Ramurd 04-20-2009 09:31 AM

a udev restart should do, don't think a hard reboot is necessary to make this stick.

First and foremost, I think you should NOT have to do a chmod/chown.

Quote:

should that be a SUBSYSTEM or a KERNEL?
i tried it as both, and did a /etc/init.d/udev restart, chgrp the ttyS0 to dialout and it still dropped back to root within 2-3 minutes.
Tbh, I don't know; I'd say KERNEL but not enitrely sure where this should reside. What I fear is that something other than udev is playing a part here, maybe the dialing software?

What happens if you'd chmod the ttyS0 device and do NOT dial out? Do the ownership and permissions change still? (This would be to determine if the dialing software may be playing a part here...)

mike at bcdaudio 05-23-2009 03:32 AM

ttyS permissions
 
Quote:

Originally Posted by Ramurd (Post 3512196)
Probably udev, take a look at your udev rules and see what group is bound to ttyS0.

Hi there, I also have had trouble with permissions with the Serial Port drivers. Symptom is when you start up gTKTerm you get 'permission denied' and you cant open the serial port.
The default rules from /etc/udev/ give permissions rw rw -- so that the root, and group uucp are allowed access , but others cannot.
I tried changing the permissions manually with chmod 666 ttyS0, and it works, but gets reset at start up.
Reading the threads here, I have just added a rule to the 91-permissions file.
KERNEL== ttyS[0-9] GROUP="uucp",MODE = "0666" , OPTIONS="last_rule"

On a re-boot, /etc/udev runs, and this rule changes the permissions to 666, so that you can access the serial ports.


I am new to Linux , so hope I have done this correctly!
Mike


All times are GMT -5. The time now is 10:14 PM.