tech-userlevel archive

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

Re: Library support for two-phase daemonization

Anthony Mallet wrote:
> Yes, I was suggesting this pattern as an alternative implementation of your
> daemon_{fork,detach} with pipe(). 
> Your suggestion solves one problem (the first use case above), and since you
> are planning to add this to libc, it may be worth trying to solve the other 
> use
> case at the same time?
> The API could be something like:
>  - daemon_fork()
>  - daemon_detach()
>  - daemon_spawn(): basically a posix_spawn() with the additional signal
>  notification pattern.

I'm afraid I still don't see why this is needed.  Is there currently
code in NetBSD using this pattern?  What advantages does it offer over
traditional daemonization?

Also, I'm specifically not trying to redesign or replace the existing
daemonization API, but just to provide the minimum functionality
needed to fix race conditions in existing NetBSD daemons.  If you
believe that can be better achieved with signals than with pipes, I'm
interested in hearing your arguments, but I'm not really interested in
solving any unrelated problems.
Andreas Gustafsson,

Home | Main Index | Thread Index | Old Index