Solved

Run a process at startup as another user than root

Posted on 2004-10-14
5
1,527 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.
Suggested Courses

710 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