Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jul 2007 22:16:19 +0200
From:      Jona Joachim <jaj@hcl-club.lu>
To:        Garrett Cooper <youshi10@u.washington.edu>
Cc:        hackers@freebsd.org
Subject:   Re: How do I daemonize a process?
Message-ID:  <20070723221619.2f336beb@spaceman.my.domain>
In-Reply-To: <46A46910.9080901@u.washington.edu>
References:  <46A46910.9080901@u.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 23 Jul 2007 01:38:40 -0700
Garrett Cooper <youshi10@u.washington.edu> wrote:

>     As the subject suggests I'm trying to determine how I can
> daemonize a C process, outside of using the rc infrastructure, so
> that it won't exit when the TTY exists. Does anyone know any quick
> references or examples? Thanks,

The daemonize() function in this small program of mine:
http://hcl-club.lu/svn/development/c/console%20c/fetchiterd/fetchiterd.c
is the right portable way to do it according to "Advanced Programming
in the UNIX Environment" by Stevens and Rago.
(I love that book)

Regards,
Jona



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