Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jun 2001 15:52:12 -0400
From:      Barney Wolff <barney@databus.com>
To:        Valentin Nechayev <netch@iv.nn.kiev.ua>
Cc:        Gregory Bond <gnb@itga.com.au>, stable@FreeBSD.ORG
Subject:   Re: Who's HUPing my daemon?
Message-ID:  <20010603155212.A32453@tp.databus.com>
In-Reply-To: <20010603185509.C891@iv.nn.kiev.ua>; from netch@iv.nn.kiev.ua on Sun, Jun 03, 2001 at 06:55:09PM %2B0300
References:  <200106010210.MAA26759@lightning.itga.com.au> <20010603185509.C891@iv.nn.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Wouldn't running the daemon under nohup in /usr/local/etc/rc.d/xxx.sh
accomplish the same thing?  I know it's inelegant, but it should work,
unless I'm missing something.
Barney Wolff

On Sun, Jun 03, 2001 at 06:55:09PM +0300, Valentin Nechayev wrote:
>  Fri, Jun 01, 2001 at 12:10:35, gnb (Gregory Bond) wrote about "Who's HUPing my daemon?": 
> 
> Proper daemonization consists of many steps, some of them are:
> 
> 1) chdir("/"), to prevent staying on file system which must be unmounted.
> (But let's consider changing sysctl kern.corefile to absolute path.)
> 2) Close all unneeded file handles, including 0,1,2, and reopen
> /dev/null or log files on them.
> 3) Setup own session with setsid(). This is exact what you need now.
> 
> Of course, daemon() will do the same in one call of itself, but it is
> unportable.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010603155212.A32453>