tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rc.d and non daemon servers



On Wed, Mar 04, 2009 at 07:57:09PM +0000, David Laight wrote:
> On Wed, Mar 04, 2009 at 08:39:54AM -0500, matthew sporleder wrote:
> > On Wed, Mar 4, 2009 at 8:29 AM, Emmanuel Dreyfus 
> > <manu%netbsd.org@localhost> wrote:
> > > Steven M. Bellovin <smb%cs.columbia.edu@localhost> wrote:
> > >
> > >> > Shall I start it with nohup /usr/local/bin/foo & ?
> > >> > Or is there a nicer alternative?
> > >> >
> > >> I've always used &.
> > >
> > > But if you start it from the shell (a la /etc/rc.d/foo start), it will
> > > exit when you leave your shell...
> > >
> > 
> > I actually like the nohup option when combined with something like 
> > rotatelogs.
> > (cd mydir; nohup ./foo.sh 2>&1 | rotatelogs logs/foo.out.%Y%m%d 86400 &)
> 
> nohup isn't enough, the process also needs to lose its controlling
> terminal.

Is this sufficient?

program < /dev/null > /dev/null 2>&1 &

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 278-3933


Home | Main Index | Thread Index | Old Index