Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1549
  • Last Modified:

Run a process at startup as another user than root

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
ferg-o
Asked:
ferg-o
  • 2
  • 2
2 Solutions
 
jlevieCommented:
Sure, something like:

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

in the rc2.d init script.
0
 
yuzhCommented:
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
 
yuzhCommented:
jlevie, you must be half second or less faster than me, same time stamp !
0
 
jlevieCommented:
Yeah, that doesn't happen all that often.
0
 
ferg-oAuthor Commented:
So close I had to split the points! Thanks...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now