Re: daemontools respin?

Charlie Brady <[email protected]> Wed, 16 Jun 2010 10:46:04 -0400 (EDT)
Newsgroups gmane.comp.sysutils.bgware
Message-ID <[email protected]>
On Sat, 12 Jun 2010, Bernhard Graf wrote:

> Charlie Brady wrote:
> 
> >>> This is much easier with the synchronous SysV startup process, with
> >>> self-daemonizing services: By terminating the main process such a daemon
> >>> can indicate, that the daemonized subprocess is ready.
...
> > How many self-daemonizing services actually do this? Most of the ones I've 
> > seen exit from the parent process as soon as possible, i.e. without 
> > waiting for any indication from the child process that it is fully 
> > ready.
> 
> You are probably right. With SysV at least the init-script writer can
> try to fix this in individual ways, e.g. waiting for a PID-File to
> appear somewhere, waiting for a socket to become available, inserting
> sleep calls or simply relying on the startup-penalty of the next script.
> 
> But first you don't have the same options with supervised daemons. When
> the supervisor starts one daemon it does not get any feedback, when this
> daemon is ready in order to start a dependant daemon.

You do indeed have the same options. The run script for the dependent 
daemon can employ just the same heuristics to determine when the daemon 
that it depends on has fully started -  waiting for a PID-File to   
appear somewhere, waiting for a socket to become available, etc.