Re: Subdirectories as service dependencies

From: Laurent Bercot <>
Date: Tue, 04 Aug 2020 01:11:26 +0000

>The log directory is currently treated as a special case, but what if it
>didn't need to be?

  The only reason for specialcasing the log directory is that s6-svscan
will maintain a pipe between the service's stdout and the logger's
stdin. It's a feature directly inherited from daemontools' svscan, and
it's very handy to have but it requires *a lot* of ad-hoc handling in
the code. In the absence of a real fd-holding infrastructure, though,
the added code is worth it because having a pipe that never closes,
even when the service and logger processes die, is just that useful.

  Unfortunately, that cannot be generalized to N sub-services, and
without the pipe holding, there is just no benefit in coupling services
in this way. It would definitely not kill the special case of
maintaining a privileged data channel from one service to the next.

  s6 just doesn't have a notion of dependency, because it doesn't need
one. The point of a supervision suite is to make sure the services
stay up, restarting as soon as they fail, so dependencies aren't
relevant. You could say that if service A depends on service B, then
you want to kill and restart A whenever B dies and restarts, but in
general that isn't a good idea: it makes your service setup *less*
reliable and cascading failure more likely, which is the opposite of
what you want to achieve with a supervision suite.

> Further, tightly coupled services would now have self-documenting
>structure (e.g. foo, foo/log, foo/server...)

  From s6's point of view, there's no such thing as tightly coupled
services. There are just services you want to maintain. And, as a
peculiarity, sometimes two services with a pipe between them.

>There is a big gap between s6 and s6-rc in terms of the knowledge needed to
>use them, and yet I feel this is an often needed feature that shouldn't
>pull in everything else s6-rc provides.

  On the contrary, a full service manager is the *only* place where
dependencies are any kind of relevant, because all they do is inform
the order in which you want to start and stop services. If you really
have "tightly coupled services" and it's important to know whether
or not to start A before B and C, then s6-rc is the tool you want.
But if you don't want to bother with all this and just need to
supervise a few daemons with pure s6, you can. It will work. The need
for a strict, official dependency structure is mostly in your head. :)

Received on Tue Aug 04 2020 - 01:11:26 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC