LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-17-2004, 11:30 PM   #1
ImpactDNI
Member
 
Registered: Jun 2004
Posts: 124

Rep: Reputation: 15
Start program at boot as non-root


I would like to start a program at boot, however, the server needs to be started as non-root. Is there a way to add it to my rc.local and have it start as a different user?
 
Old 07-18-2004, 12:47 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Sure:

su <user> -c <command>

in rc.local causes <command> to run as <user>.
 
Old 07-18-2004, 09:53 AM   #3
ImpactDNI
Member
 
Registered: Jun 2004
Posts: 124

Original Poster
Rep: Reputation: 15
why is it that you dont need a password?
is it due to rc.local running as root? and therefore root doesn't need a pass to get into other people's accounts?
 
Old 07-18-2004, 12:02 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Exactly -- root can su to any other user without a password.
 
Old 07-18-2004, 12:44 PM   #5
ImpactDNI
Member
 
Registered: Jun 2004
Posts: 124

Original Poster
Rep: Reputation: 15
one last newb question =P

su _____ -c command1
command2

will command2 be run as root or _____?
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Start a daemon/program at boot SchwipSchwap Linux - Newbie 15 01-24-2006 01:58 AM
How do I start a program on boot ? overproof Mandriva 4 04-22-2005 07:13 AM
program start at boot moonloader Slackware 4 03-08-2004 06:33 AM
Can't start program using X in root console! nyk Linux - Software 7 02-10-2004 06:46 PM
Getting a program to start with root privileges when a user logs in. joeking Linux - Security 4 10-24-2003 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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