Date: Mon, 23 Jul 2007 01:56:36 -0700 From: Garrett Cooper <youshi10@u.washington.edu> To: Jose-Marcio.Martins@ensmp.fr Cc: hackers@freebsd.org Subject: Re: How do I daemonize a process? Message-ID: <46A46D44.9050504@u.washington.edu> In-Reply-To: <46A46CE2.4060607@ensmp.fr> References: <46A46910.9080901@u.washington.edu> <46A4699C.5080906@u.washington.edu> <46A46A40.1080004@fs.ei.tum.de> <46A46CE2.4060607@ensmp.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
Jose-Marcio Martins da Cruz wrote: > Simon 'corecode' Schubert wrote: >> Garrett Cooper wrote: >>> Garrett Cooper 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? > > >> >> I suggest daemon(3) if it doesn't have to be portable. > > Or something like this, if it has to be portable or if you don't want > to modify C code : > > nohup /pathto/c-application & > > You'll eventually need to add things like redirect stdout to /dev/null... > > Ok, many thanks for the suggestions all :). I'm more than happy not to do the double fork(2) solution =\.. -Garrett
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46A46D44.9050504>