LinuxQuestions.org
Review your favorite Linux distribution.
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 02-07-2006, 05:07 PM   #1
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Rep: Reputation: 30
How do you control who run a particular program at startup?


Assuming I have this script called 'testscript' in /etc/rc2.d/
Code:
/etc/rc2.d/S20testscript -> ../init.d/testscript
Is it possible for 'testscript' to run as USER 'userA' instead of 'root' at startup, so that if I do a 'ps aux', I'll get

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
----------------------------------------------------------------------
userA 6334 0.0 0.5 443 443 ? Ss 06:20 0:00 /usr/bin/testscript
^
|
userA instead of root here
(which is shown correctly above)


Thanks.

Last edited by Akhran; 02-07-2006 at 05:21 PM.
 
Old 02-07-2006, 05:51 PM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Probably not the rc script itself, but you could make that script use su to pass on any specific work to a user.
Code:
su -c /usr/bin/myprog userA
 
  


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
Run program before KDE startup carl.waldbieser Linux - Software 8 06-30-2006 08:15 PM
Run program on startup as user startail Linux - Software 2 10-08-2004 05:06 AM
How to fully control a program within another program marri Programming 5 07-28-2004 09:04 PM
run program at startup.. me again.. :) rohan208 Linux - General 2 05-26-2004 08:03 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 08:19 AM

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

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