Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Run a process at startup as another user than root

Posted on 2004-10-14
5
Medium Priority
?
1,534 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 1000 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 1000 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

Technology Partners: 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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

722 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