Solved

Run a process at startup as another user than root

Posted on 2004-10-14
5
1,517 Views
Last Modified: 2013-12-27
We have an application that the client would like to kick off as another user than root. The script to start the processes is in /etc/rc2.d. Is there a way to do this?
0
Comment
Question by:ferg-o
  • 2
  • 2
5 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 250 total points
Comment Utility
Sure, something like:

su -c - some-user "/path-to/some-executable"

in the rc2.d init script.
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 250 total points
Comment Utility
In your startup startup script, you do:

su - fred -c "/path-to/app"

this will run app as user fred.

man su
to learn more details
0
 
LVL 38

Expert Comment

by:yuzh
Comment Utility
jlevie, you must be half second or less faster than me, same time stamp !
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Yeah, that doesn't happen all that often.
0
 
LVL 4

Author Comment

by:ferg-o
Comment Utility
So close I had to split the points! Thanks...
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now