Re: daemontools respin?
Bernhard Graf <[email protected]> Sat, 12 Jun 2010 10:36:45 +0200
| Newsgroups | gmane.comp.sysutils.bgware |
|---|---|
| Message-ID | <[email protected]> |
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. >> >> As much as I hate self-daemonizing services, this an advantage to them >> (possibly the only advantage IMNSHO). Other signalling mechanisms could >> be devised, but they're not nearly so intrinsic. > > 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. And second your objection doesn't help, because those examples are broken anyway (possible race conditions), and if anyone wants to do it better, he should not design the new code after a broken prototype. -- Bernhard Graf