Subject: Re: Correct way to start a server as a user in rc.local?
To: Clint \(cpctc\) <cpctc_cbw@hotmail.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-help
Date: 12/10/2001 18:33:50
On Mon, Dec 10, 2001 at 07:33:18AM -0500, Clint (cpctc) wrote:
>
> I want to run a tcl server via rc.local. When I'm at my shell prompt, I
> start it with:
>
> # /usr/pkg/bin/tclsh myserver.tcl
>
> .. and it logs to stdout and /var/log/messages via 'logger'/syslog.
>
> I want to have the thing start up at boot in rc.local, and for it to run as
> user "myuser".
>
> Because it logs to syslog, I'd like to redirect stdout and stderr to
> /dev/null.
>
> I'm sure there's a few ways to do this.. can anyone suggest the preferred
> method?
I would do:
su myuser -c "/usr/pkg/bin/tclsh myserver.tcl" > /dev/null 2>&1
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
--