LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 03-18-2004, 08:22 AM   #1
klytu
Member
 
Registered: Mar 2004
Location: Eastern United States
Distribution: Ubuntu
Posts: 65

Rep: Reputation: 15
modem lights applet question from rookie


I am very new to Red Hat Linux 8 and have been using and having fun with the Gnome desktop under X-Windows. I decided to use the graphical interface to gently introduce Linux before moving on to the power of the shell. I recently found the cool modem lights applet that simulates the lights of an external modem. There is one problem I am having that I can't figure out how to solve. I can use the applet to connect to or disconnect from the internet with a single click only as the root user. When I am logged in as a user other than root, the applet still lights when I am connected and shows the throughput and modem status, but when I attempt to connect using the applet the normal confirmation box pops up and when I try to connect or disconnect the modem nothing happens. The settings for the applet appear to be correct in my case - it finds the modem at ttyS1 and set up a lock file, but apparently users other than root can only read the lock file. Hopefully, I haven't been too confusing in all this rambling, but if anyone can help I thank you in advance!
 
Old 03-18-2004, 06:29 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, SolydK 2013
Posts: 7,434

Rep: Reputation: 134Reputation: 134
" I can use the applet to connect to or disconnect from the internet with a single click only as the root user."

One possibility is that /dev/ttyS1 may be set up for rot access only. Log in as root and use the ls command to display the ownership and permissions of /dev/ttyS1:
ls -l /dev/ttyS1

For user access the ownership should be: root uucp
And the permissions should be lwrxwrxwrx (which is the same thing as 777).

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
Old 03-19-2004, 05:12 AM   #3
klytu
Member
 
Registered: Mar 2004
Location: Eastern United States
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 15
Thanks for the response, jailbait! OK, when I do ls -l /dev/ttyS1 I get:

crw-r----- 1 root uucp

Is this the problem? If so, how can I correct it and where can I get more information to understand what this means? Thanks, again!
 
Old 03-19-2004, 08:37 AM   #4
klytu
Member
 
Registered: Mar 2004
Location: Eastern United States
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 15
Jailbait: Just read the "Quick and Dirty Guide Linux File Permissions" here and I think I understand what to do to change the permissions when I get home tonight. IMy intuition is that the permissions on /dev/ttyS1 are not the problem, but I will give it a shot as you suggest just in case. I will post back with the result. Thanks again!
 
Old 03-19-2004, 09:41 AM   #5
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, SolydK 2013
Posts: 7,434

Rep: Reputation: 134Reputation: 134
"crw-r----- "

Your permissions are the problem. In my post I stated the permissions incorrectly for /dev/ttyS1. I should have said crwxrwxrwx.


___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
Old 03-19-2004, 05:38 PM   #6
klytu
Member
 
Registered: Mar 2004
Location: Eastern United States
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 15
OK. I changed the permissions on /dev/ttyS1 with chmod and checked them. Before I connect to the internet the permissions read crwxrwxrwx 1 root uucp. I tried to then connect with the modem lights applet still can't connect. I now connect with "network device control" and the permissions on /dev/ttyS1 change to crwxr-xr-x 1 root uucp. See, I can and always could connect using my modem with "network device control" as either root or another user. As root I can also connect or disconnect with a single click on the modem lights applet; but as a user other than root the applet displays throughput and lights up properly but won't allow me to connect or disconnect with it. I hope this isn't all too redundant, but I just wanted to make it clear what is happening. It is obviously only a minor issue because my modem can connect fine. It's just slightly inconvenient and a little baffling that the applet only works fully when I am the root user. And I can't figure out why.
 
Old 03-19-2004, 06:34 PM   #7
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, SolydK 2013
Posts: 7,434

Rep: Reputation: 134Reputation: 134
I am not sure what the key to this puzzle is. With permissions of crwxr-xr-x then the behavior of the modem lights applet is easily explained by the fact that the modem lights applet can not write to the modem. Therefore it cannot issue commands to the modem to connect and disconnect.

"I now connect with "network device control" and the permissions on /dev/ttyS1 change to crwxr-xr-x 1 root uucp."

So network device control changes permissions on /dev/ttyS1 and only allows root to write to the modem which means that only root can connect or disconnect the modem. This brings up two questions in my mind.

When you connect to the internet using network device control does it ask you for the root password so that network device control can run as root? Not only does network device control have to run as root to write to the modem with the crwxr-xr-x permissions, it also has to run as root to change the permissions.

Have you tried running the modem lights applet when the permissions are, for sure, crwxrwxrwx? If the answer is yes then I am puzzled as to what is changing the permissions every time /dev/ttyS1 is accessed if it is not network device control.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
Old 03-19-2004, 06:44 PM   #8
Pwnz3r
Member
 
Registered: Jan 2004
Location: Lancaster, OH
Distribution: Gentoo
Posts: 393

Rep: Reputation: 30
Edit the /etc/group file and add your username to the 'tty' group. I think that should work fine.
 
Old 03-19-2004, 06:54 PM   #9
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, SolydK 2013
Posts: 7,434

Rep: Reputation: 134Reputation: 134
I just tried an experiment with my Fedora system. I set the permissions of my modem, /dev/ttyS1, to 777. Then I started kppp which, as usual, asks for my root password. Immediately after I connect to my ISP my /dev/ttyS1 permissions become crwxr-xr-x. So something in kppp reset my /dev/ttyS1 permissions which is a new idea to me.


___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
Old 03-19-2004, 08:43 PM   #10
Pwnz3r
Member
 
Registered: Jan 2004
Location: Lancaster, OH
Distribution: Gentoo
Posts: 393

Rep: Reputation: 30
Did you try what I mentioned, because devices aren't like files so they don't keep the permissions when changed. In other words, the "files" in the /dev folder are not files, but instead they are parts of your system made to look like files so that the OS can access them with ease so all changes to the permissions will be shortly stored in RAM. So add the name you want to allow to connect/disconnect to the tty group.

Last edited by Pwnz3r; 03-19-2004 at 08:46 PM.
 
Old 03-19-2004, 11:28 PM   #11
klytu
Member
 
Registered: Mar 2004
Location: Eastern United States
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 15
Pwnz3r: I tried your suggestion, but it had no effect on the behaviour. Just to check to see if I did it right - I logged in as root and in the file etc/group I typed in the user name at the end of the line
tty:x:5: Then I saved the file, logged out of root, and logged in as user. If those were the right steps, it didn't work - still can't connect or disconnect through the modem lights applet as user other than root.
 
Old 03-19-2004, 11:32 PM   #12
klytu
Member
 
Registered: Mar 2004
Location: Eastern United States
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 15
Jailbait: When I connect to the internet using network device control it does not prompt me for the root password when I am a user other than root; I just select the modem, click "activate" and then the modem dials right in and connects.
 
Old 03-20-2004, 07:11 AM   #13
GregLee
Member
 
Registered: Feb 2004
Location: Waimanalo, HI
Distribution: Slackware 10, Fedora 6
Posts: 308

Rep: Reputation: 30
Try becoming root and doing "chmod u+s /usr/sbin/pppd".

Modemlights doesn't know about making/breaking a ppp connection, itself, it calls scripts to do this. Which scripts are called is configurable by clicking modemlights->properties. The scripts are probably ppp-on and ppp-off, and they are probably in /usr/sbin. You can call them from the commandline to get the same effect as clicking the modemlights button. ppp-on, in turn, calls pppd, which sets up the ppp connection for you. You can examine the script ppp-on and use "man pppd" to get the details. To do its work for non-root users, pppd has to have root privileges, so it has to be made suid root. It's my guess, that is what is going wrong for you. pppd was not installed suid root, so that's what you have to change to fix it.

Last edited by GregLee; 03-20-2004 at 07:12 AM.
 
Old 03-21-2004, 06:53 AM   #14
klytu
Member
 
Registered: Mar 2004
Location: Eastern United States
Distribution: Ubuntu
Posts: 65

Original Poster
Rep: Reputation: 15
GregLee: Thanks for the info on pppd. Your suggestion indirectly helped me solve my problem. In my case, the script being called by modem lights to connect is "ifup ppp0" and to disconnect is "isdown ppp0". I tried typing the command directly from a command line first as root and the as a non-root user. As root the modem would connect and disconnect immediately. But as a non-root user I would get the message "Failed to execute command: no such file or directory" when I tried typing the command directly. I did a search for "ifup" and found that it was in the /sbin directory. Typing the command as /sbin/ifup ppp0 connected smoothly so I just changed the appropriate lines in the preferences of modem lights to correspond. I would guess that what was happening was that when the command was issued as root, /sbin was already in the root user's "path" ( to use a Windows/DOS analogy), while it is not in a non-root user's "path". Now that I have the applet working as desired, I am going to experiment by "chmod"ing all the files I changed the permissions on back to the way they were when I originally posted to see if that has any effect on the behaviour . So, what started as a simple question ended up leading me to learn about permissions and how to change them and is now leading me to investigate whether there is a concept of "path" in Linux. Thanks again to everyone who posted and helped!
 
Old 03-21-2004, 11:34 AM   #15
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, SolydK 2013
Posts: 7,434

Rep: Reputation: 134Reputation: 134
"and is now leading me to investigate whether there is a concept of "path" in Linux."

Yes, Linux has paths. You can find out what your current path is with:

echo $PATH

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot find modem lights applet in Ubuntu Hoary JDW Ubuntu 9 06-12-2005 05:33 AM
Modem Lights Applet Configuration grantpotter Linux - Software 0 02-23-2004 07:21 PM
modem lights applet problem patrickfreen Red Hat 7 02-23-2004 10:36 AM
hi, question of a rookie Killah Linux - Hardware 2 02-17-2004 02:10 PM
Modem Lights applet source? motyl Linux - Software 2 05-12-2003 06:15 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration