Re: Some suggestions about s6 and s6-rc

From: Guillermo <>
Date: Sat, 19 Sep 2015 13:03:32 -0300

2015-09-19 10:17 GMT-03:00 Casper Ti. Vector:
> On Sat, Sep 19, 2015 at 02:26:44PM +0200, Laurent Bercot wrote:
>> So, I don't mind the asymmetry because it's a natural one given the
>> way a system works, and working around it is trivial. I only made
>> the "down" script optional because it's true that a lot of oneshots
>> won't have anything to do when being turned off; but the opposite is
>> exceptional. Does it really bother you?
> Well, it is more of a "mathematical" ugliness to me -- a workaround is
> also trivial. If the proposed change is applied, it will make the model
> (very) slightly better with nearly negligible cost, so this is really up
> to the party in charge: I usually choose to apply such changes, but this
> time it finally depends on your taste.

Well, I for one wouldn't like that change, for the reasons Laurent
stated. Also, 'finish' scripts for daemontools-like supervision suites
are optional, as well as a stop() function for OpenRC scripts that
have an explicit start(). Being forced to always do 'touch down; chmod
a+x down' for s6-rc oneshots, to always write "stop() { ; }" in OpenRC
scripts, or to always do:

cat <<EOF >finish
#!/bin/execlineb -P
chmod a+x finish

for an s6 service directory or s6-rc longrun would quickly become an
annoyance for me :-P

2015-09-19 11:52 GMT-03:00 Laurent Bercot :
> On 19/09/2015 14:52, James Powell wrote:
>> I've often wondered if services started via OpenRC could be ran
>> wrapped to s6, such as instead of scripting to start the daemon
>> normally via direct execution, you start it wrapped via OpenRC by
>> executing the s6 run script and stopped by the finish script within
>> the OpenRC script acting as a manager layer.
> I think that's what the "supervisor=s6" variable does.

Indeed. _at_James:

depend () {
  need s6-svscan
# Other dependencies, ordering constraints (i.e. 'before', 'after')
# No start() or stop() functions.

Add an s6 service directory with a 'run' (and 'finish', if needed)
script in /var/svc.d with the same name as the script in /etc/init.d,
and you get what you wanted. You have a service supervised by s6 that
you can also start or stop with rc-service, add or remove from a
runlevel with rc-update, etc.

Received on Sat Sep 19 2015 - 16:03:32 UTC

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