Solved

Run a process at startup as another user than root

Posted on 2004-10-14
5
1,519 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
ID: 12315119
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
ID: 12315121
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
ID: 12315140
jlevie, you must be half second or less faster than me, same time stamp !
0
 
LVL 40

Expert Comment

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

Author Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

912 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

17 Experts available now in Live!

Get 1:1 Help Now