:: Re: [DNG] startup scripts (was dng@…
Inizio della pagina
Delete this message
Reply to this message
Autore: Laurent Bercot
Data:  
To: dng
Oggetto: Re: [DNG] startup scripts (was dng@lists.dyne.org)
On 18/07/2015 09:52, Didier Kryn wrote:
> There are two categories of launchers: supervisors and
> non-supervisors. Similarly, I think two scripts only are needed for
> every daemon: one for launching without supervision, alla sysv-init
> and one for launching from a supervisor. Just two, not one per every
> launcher/supervisor.
>
> Further more, a method could be agreed on to tell the script if the
> daemon is going to be supervised or not, and we would then need only
> one script for all cases.
>
> For example, providing "supervised-start" and "supervised-reload" in
> addition to the other cases could do the job. For safety, the scripts
> could check a file which tells them which supervisor is calling
> them.
>
> What do you think?


It's a bit more complicated than that.

Supervision suites don't only take a script, they take a whole
"service directory" where the configuration is stored. Which is a
good thing, because it involves not only the daemon-starting script,
but cleanup procedures, readiness notification procedures, and other
details on how to properly supervise the daemon.

The daemon-starting script itself is launched by the supervisor
without arguments, so you cannot call it as "foo supervised-start".
You could provide one unique script for every daemon that does just
what you suggest, but you would still have to provide a complete
service directory in addition to it.

And the service directory isn't exactly the same depending on the
chosen supervision suite. daemontools, runit, s6, perp and nosh all
have subtly different options, so even if you have a common basis
and simple daemons can use the same service directory with several
supervision suites, when you get into advanced stuff such as
readiness notification,configuration details must be handled
differently.

Believe me, providing sysv-rc compatibility when you're working on
a supervision suite is no small feat: the paradigm is very different,
and when you've had a taste of supervision, you realize how poor the
sysv-rc model is and how hard it is to contort yourself to fit into
the box. If it was easy, we would have provided compatibility packages
long ago, and supervision would already rule the world (with a gentle,
good hand).

--
Laurent