LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 03-23-2006, 09:26 AM   #1
Ka Ora
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
Unhappy problems with launching script on login...


I've been playing around with some distributions, but I'm still a newbie.
I've recently installed SUSE 10.0 OSS on a packard bell easynote laptop with pretty good results (after having upgraded it for MP3, DVDs, flash...). I've also installed as root madwifi to control a D-link DWL-G650+ pcmcia adapter.
I've written a little script to bring up the interface an connect with an access point. Script works correctly. I need this script to be executed each time any user login.
On Fedora, putting this kind of scrpit in /bin and launching it from /etc/profile it worked perfectly for every user. Now on SUSE, putting it in /bin and launching it from /etc/profile.local only works for root. Questions :

-> How can I make it work for any user ?
-> Do I simply have to modify the PATHs of the users ?
-> Should I use something else than /etc/profile.local ?

Thanks for your help. You'll really free me from an impasse.
 
Old 03-23-2006, 05:05 PM   #2
fragos
Senior Member
 
Registered: May 2004
Location: Fresno CA USA
Distribution: Ubuntu 10.10
Posts: 1,466

Rep: Reputation: 51
Depends on KDE or Gnome. For KDE, place the script in /home/{user name}/.kde/Autostart. Make sure the permissions are set for execute. Now whenever that user logs in the script will be run.
 
Old 03-25-2006, 04:18 PM   #3
Ka Ora
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Question

Thank you fragos, your solution worked... for root. But thanks to it, I discovered a bit more about the problem : the script I've written to connect with the access point contains the line :

ifconfig ath0 up

wich brings up the wireless interface. But running it as a user and not root results in the following message :

SIOCSIFFLAGS: Permission not allowed

I've verified and updated the PATHs and the permissions. It seems the problem resides in accessing ath0 being a user. Does anybody know what's happening ?
 
Old 03-25-2006, 05:06 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You can add the line including the full path to the sudoers file using "visudo" as root. Use the NOPASSWD option. This allows you to have the command in a script without prompting for a password. Enter the full exact command and use the full path to the command to run. At first glance, being able to run a root command without a password may seem like a problem, but if it is debugged (doesn't crash) and doesn't contain an escape (such as vi's ":!" or sendmail's shell escape), it means that you don't have to give other users the root password.

See man sudo and man 5 sudoers for more details.

As an alternative, use kinternet instead of a login script. You can scan for networks and authenticate using it.

Also, If your script isn't contained in /etc/profile.local but called from there, /usr/local/sbin would be a more logical location for it than /bin.

The Filesystem Hierarchy Standard contains an explanation:
http://www.tldp.org/LDP/Linux-Filesy...Hierarchy.html
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
launching programs from a bash script Ian D Linux - Software 2 10-25-2005 04:31 PM
Launching GKrellm At Login? spaaarky21 Fedora 2 02-13-2005 02:56 PM
launching a script from rc.d invar Linux - Software 5 08-16-2004 03:42 PM
mozilla 1.7 launching script mrpringle Linux - Software 3 07-09-2004 04:46 PM
Launching Firebird through a script Travis S Linux - Software 5 02-03-2004 09:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 10:56 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