Don my plumbers outfit and twist a lot of pipes into shape:
When -d(ebug) is specified we fork before calling daemon.
The parent process becomes a miniature cat(1) program which connects
stdin/stdout with the management process stdin/stdout.
It also knows that SIGINT should be passed on to the management process
in order to make it DTRT.
Any other cause of death for this "debugger" process will (once I
teach the CLI about it) not affect the running varnish and therefore
it will be possible to start varnish in debugging mode, tweak things
a bit and CTRL-D and leave it running in the properly daemon(3)'ed
background.
The reason for this rather complicated bit of pipework is that we
can not call daemon(3) once we have started any threads (only the
calling thread survives) and we would loose our parent relationship
to the cache process also.
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@604
d4fa192b-c00b-0410-8231-
f00ffab90ce4