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

Bug#733452: Fw: Library support for two-phase daemonization



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 ---
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


Reply to: