LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 04-16-2009, 03:44 PM   #1
emetib
Member
 
Registered: Feb 2003
Posts: 484

Rep: Reputation: 33
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?
 
Old 04-17-2009, 08:52 AM   #2
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
Probably udev, take a look at your udev rules and see what group is bound to ttyS0.
 
Old 04-17-2009, 09:05 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
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.
 
Old 04-17-2009, 10:41 AM   #4
emetib
Member
 
Registered: Feb 2003
Posts: 484

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by Ramurd View Post
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?
 
Old 04-18-2009, 04:22 AM   #5
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
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.
 
Old 04-19-2009, 01:14 PM   #6
emetib
Member
 
Registered: Feb 2003
Posts: 484

Original Poster
Rep: Reputation: 33
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?
 
Old 04-20-2009, 09:31 AM   #7
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
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...)
 
Old 05-23-2009, 03:32 AM   #8
mike at bcdaudio
LQ Newbie
 
Registered: Dec 2008
Location: England
Posts: 3

Rep: Reputation: 1
Smile ttyS permissions

Quote:
Originally Posted by Ramurd View Post
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
 
1 members found this post helpful.
  


Reply



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
changing a user's group Z038 Linux - General 2 02-07-2008 08:03 PM
Changing Group carlosinfl Linux - General 4 01-10-2007 01:21 PM
changing group twallstr Linux - Newbie 2 09-11-2005 03:00 PM
Changing group in Konqueror? miscreant Linux - Software 1 07-08-2005 05:42 PM
changing the group anwar_lpk Linux - Networking 2 05-08-2003 10:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:07 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration