Hello, Ian, it seems like NetBSD people are discussing readiness protocols as well: http://mail-index.netbsd.org/tech-userlevel/2014/01/28/msg008402.html -- Cheers, Andrew
--- Begin Message ---
- To: tech-userlevel@NetBSD.org
- Subject: Re: Library support for two-phase daemonization
- From: Joerg Sonnenberger <joerg@britannica.bec.de>
- Date: Tue, 28 Jan 2014 19:19:30 +0100
- Message-id: <20140128181930.GA9014@britannica.bec.de>
- Mail-followup-to: tech-userlevel@NetBSD.org
- In-reply-to: <21223.61263.989443.746257@guava.gson.org>
- References: <21223.61263.989443.746257@guava.gson.org>
On Tue, Jan 28, 2014 at 07:56:31PM +0200, Andreas Gustafsson wrote: > Comments? Objections? I don't like the approach. I would to just extend the existing daemon interface slightly. (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. (3) A new argument provides the default exit code in case the child terminates before writing the status byte. Whether a timeout should be provided as fourth argument is a question I can't answer right now. Note that the existing daemon functionality can be obtained by just closing the descriptor returned by daemon2. Joerg
--- End Message ---
Attachment:
signature.asc
Description: PGP signature