tech-userlevel archive

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

Re: Library support for two-phase daemonization

Andrew Shadura wrote:
> On Tue, 28 Jan 2014 19:19:30 +0100
> Joerg Sonnenberger <> wrote:
> > (1) daemon2() returns a filter descriptor. It is the responsibility of
> > the child to write '\0' to this fd and close it, once it is done with
> > initialisation.
> > (2) If the child writes a code other than '\0', it is interpreted as
> > error by the parent and used as exit status.
> First of all, I'm sorry for replying to a two months old thread, but
> this seems to be similar to what Ian Jackson proposed in debian-ctte@
> around the same time (Cc-ed to a bug report #733452)
> :

That discussion seems to be about non-forking daemons, while my
concern when starting the present thread was with forking daemons.

For forking daemons, there is already an established protocol for
determining readiness: simply wait for the parent process to exit.
My goal was only to simplify the implementation of that protocol,
not to define a new one.  While the library functions I proposed
communicate through a file descriptor (with or without the changes
Joerg suggested), that communication does not form a readiness
protocol in the sense of the Debian discussion because it is all
internal to the daemon implementation.

> I think it's worth joining forces in developing a common daemon
> readiness protocol.

If you think NetBSD needs a readiness protocol for non-forking
daemons, that's fine, but I think it should be a separate discussion.

Andreas Gustafsson,

Home | Main Index | Thread Index | Old Index