[SunHELP] starting a process as user JoeDoe
Jim Pennino
jimp at specsol.com
Wed Sep 24 13:12:25 CDT 2003
On Wed, Sep 24, 2003 at 03:03:37PM -0300, Fernando Machado wrote:
> Friends!!!
>
> Needdanother help! how do i start a process in rc2.d but not as root, as
> a user?
> i need to start tomcat as user tomcat, but if i insert anything in
> rc2.d, it will start as root and will not work.
>
> thanx!!!!!!
>
> [ ]4s!
> _______________________________________________
> SunHELP maillist - SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp
The file in rc2.d should be a link (hard or symbolic; both are used) to
a file in /etc/init.d.
Anyway, within the file you do something like:
start)
test -f file-to-start || exit 0
su user-name -c "file-to-start -option1 -option2"
--
Jim Pennino
More information about the SunHELP
mailing list