Re: run templates for runit/s6

From: Laurent Bercot <>
Date: Sat, 04 Oct 2014 10:50:15 +0100

  For simple services, it's looking good, except for this part:

> The "probe to see if it really is installed" is an unfortunate necessity as
> Debian allows the init.d script to be left in place even when the program
> is removed, and one of my goals is to support the "drop in and replace SysV
> init scripts" feature; so this is a rough emulation of that behavior. Yes,
> the init.d scripts really do silently abort if the program is not present.

  Well you really don't want to do this. In SysV the failure just happens once,
but here the supervisor will try and start the service again and again, every
second, using up CPU and filling up your logs with error messages.
  The right way to proceed is to remove the service directory (or symlink)
from the scan directory when you remove the package, the same way you add
such a link when you install the package. You can keep the scripts, and your
whole set of service directories, as a part of your "sysvrc drop-in
replacement" package, but you have to make sure you only launch a supervisor
on the services that are actually installed. You cannot have a supervisor
running for every potential service under the sun - that would be way uglier
and wasteful than the original SysV, which would defeat the purpose :)

  Yes, that means you'll have to edit the post-install and pre-removal scripts
in every service package. I'm afraid there's no way around it: SysV does not
care whether your daemon is "wanted up" or not, so it can get away with
trying and silently failing, but supervision does, and cannot.

> I haven't gotten the s6 image up and running yet, so I don't have anything
> for s6-scripts. Hang in there - I hope to have a image up and get the
> source pulled in and built sometime this weekend. I looked briefly at how
> the service directories are set up, and I'm hopeful that I might be able to
> cross-pollinate both with similar (or the same) scripts when possible.

  Run scripts should work the same for runit and s6. The differences are in
the way the supervisors themselves work: you'll need porting work, for instance,
if you want control file support (runit-specific) or startup/shutdown
notification support (s6-specific), but the run and finish files should be
reusable as is.

Received on Sat Oct 04 2014 - 09:50:15 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:18 UTC