• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1542
  • 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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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