LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-14-2011, 05:26 PM   #1
demencia
LQ Newbie
 
Registered: May 2011
Posts: 29

Rep: Reputation: 0
Question Run command as root on startup


As I tried to explain on the title, what i need is to run this command "NetworkManager --no-daemon" as root every time I start my arch+gnome so that the nm-applet would show on the panel.
I need to know a way to do this automaticaly each time I start my pc.

Thank you in advanced!

demencia.
 
Old 05-14-2011, 05:34 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,999
Blog Entries: 11

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
Set-up a sudoers line that allows your user to run nm w/o password.
Wrap a script around that, and tie into whatever Gnome runs during
session initalisation.


Cheers,
Tink
 
1 members found this post helpful.
Old 05-14-2011, 06:02 PM   #3
demencia
LQ Newbie
 
Registered: May 2011
Posts: 29

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
Set-up a sudoers line that allows your user to run nm w/o password.
Wrap a script around that, and tie into whatever Gnome runs during
session initalisation.


Cheers,
Tink
Hey Tink! In the first place, thank you very much for your quick reply!

Would you mind going a bit deeper in the explanation as I'm quite new to arch (only a couple of hours :3).
How do I set-up a sudoers line that allows my user to run networkmanager without password?
I did understand the rest of the procedure

Thank you again!
 
Old 05-14-2011, 06:07 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,999
Blog Entries: 11

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
you find out where the nm executable lives.
then you become root, and invoke visudo
find a line that mentions your user, or a group your user
is part of, and add: NOPASSWD: /path/to/nm
E.g.,
Code:
%wheel  ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/halt, /sbin/reboot, /path/to/nm, ALL
Note: I never tried this with a GUI app, this may or may not
work; if it doesn't, try the gome gui frontend for sudo inside
your wrapper script.



Cheers,
Tink

Last edited by Tinkster; 05-14-2011 at 06:08 PM.
 
1 members found this post helpful.
Old 05-14-2011, 06:09 PM   #5
demencia
LQ Newbie
 
Registered: May 2011
Posts: 29

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
you find out where the nm executable lives.
then you become root, and invoke visudo
find a line that mentions your user, or a group your user
is part of, and add: NOPASSWD: /path/to/nm
E.g.,
Code:
%wheel  ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/halt, /sbin/reboot, /path/to/nm, ALL
Note: I never tried this with a GUI app, this may or may not
work; if it doesn't, try the gome gui frontend for sudo inside
your wrapper script.



Cheers,
Tink
Excellent, I think that'll do perfect.

Thank you again!

SOLVED
 
Old 05-14-2011, 06:25 PM   #6
demencia
LQ Newbie
 
Registered: May 2011
Posts: 29

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by demencia View Post
Excellent, I think that'll do perfect.

Thank you again!

SOLVED
Actually I found the best way doing this was removing network from daemons and adding networkmanager right after hal, and if you have fam, it has to go after networkmanager
 
Old 05-14-2011, 06:28 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,614
Blog Entries: 2

Rep: Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070Reputation: 4070
If you have found the solution to your problem please mark the thread as solved, using the thread-tools on the top of the thread.
 
  


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
Run Python script as root at startup StuL Linux - General 2 03-05-2008 06:33 PM
why lftp command run failed when user isn't root, but ok when logining as root steven_yu Linux - Software 0 06-06-2007 09:36 PM
How do I run a startup script as a user other than root? Questor21 Linux - Software 4 04-08-2006 12:51 PM
Cube crashes on startup (Unless run as root) jimdaworm Linux - Games 2 05-11-2004 12:22 PM
Startup service run by user other than root? WeNdeL Linux - Newbie 5 03-20-2003 03:57 PM


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