[master] 1f45a46 Turn daemonize() inside out, and don't let the original process die until we have started the child process.

Poul-Henning Kamp phk at phk.freebsd.dk
Thu Dec 22 23:24:31 CET 2016


--------

This is my attempt to solve all, or at least many, of the issues
related to errors during startup.

Normal daemonize() immediately throws the original process away
after detaching the demonized process.

Now we keep the original "daemonize" process around, so that it can
exit(3) suitably based on what the detached (= varnishd master)
process finds out.

Ideally we should wait for even more conclusive evidence of the
child process running, but I am not quite sure what the evidence
should be ?  uptime > 0 ?  First request handled ?  (Ideas welcome...)

It's going to be bear to write test-cases for this, so I would
really appreciate it if some of you could spend half an hour stressing
it manually.

See also tickets 2141 & 2041, 

>commit 1f45a46516ec265fd983d8a2fca5f97deed96fc6
>Author: Poul-Henning Kamp <phk at FreeBSD.org>
>Date:   Thu Dec 22 22:14:58 2016 +0000
>
>    Turn daemonize() inside out, and don't let the original process
>    die until we have started the child process.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list