Re: s6 as a systemd alternative

2017-06-28 Thread Luis Ressel
On Wed, 28 Jun 2017 12:44:28 -0400
Steve Litt <sl...@troubleshooters.com> wrote:

> 2) Install s6, but run it strictly as a process supervisor

You'd quickly run into dependency problems this way, though. There's a
reason why we have service managers such as s6-rc and anopa.

s6 is powerful on is own, so by all means, switch to it. But as soon as
you feel the need for oneshots or inter-service dependencies, keep in
mind that you'll probably be better of using s6-rc.

Cheers,
Luis Ressel


Re: How to use s6 and s6-rc together

2017-05-18 Thread Luis Ressel
On Thu, 18 May 2017 16:28:17 -0500
Robert Hill <hilljamesrob...@gmail.com> wrote:

> The overview for s6-rc
> <http://skarnet.org/software/s6-rc/overview.html> mentions that:
> 
> > the chosen init should make sure that a s6 supervision tree is up
> > and running. s6-rc will only work if there is an active s6-svscan
> > process monitoring a scan directory.  
> 
> This is a little confusing to me, and I am sure I am not understanding
> correctly. If s6-svscan is monitoring a scan directory, won't all the
> processes in that scan directory already have been started by the
> s6-supervise instances that get started by s6-svscan? I would like to
> use s6-rc to start all services and s6 to supervise them once started.

Yes, when your init exec's into s6-svscan, it will immediately start all
services in the scandir (unless the corresponding servicedir contains
a down file).

However, the scandir will typically be empty at this point (it may
contain an early getty service). It is only populated with services
once you call s6-rc-init (to be exact, s6-rc-init creates the
servicedirs in /run/s6-rc/servicedirs and then symlinks them into the
scandir). s6-svscan will still not start the services, though, since
all the servicedirs created by s6-rc-init will contain a down file.
They will only be started once you call s6-rc -u change ok-all (ok-all
being the s6-rc bundle containing all your services).

Have you checked out the s6-linux-init package? It will generate an
init script that takes care of all the subtleties required to start
s6-svscan and kick of s6-rc. The only thing you still have to do by
yourself it writing the actual s6-rc services (and the s6-rc package
contains an example/ dir you can use as a reference for that).

> The page for s6-supervise
> <http://skarnet.org/software/s6/s6-supervise.html> indicates that it
> will only start services if the default service state is up. Does
> that imply that the default service state for all services with
> dependencies should be down, so that they do not get started when
> s6-svscan is run (thus enabling s6-rc to start them according to the
> dependency graph)?

Yes, the default state for all services managed by s6-rc should be
"down". But that doesn't mean you have to drop a down file in every
service directory; as I mentioned above, s6-rc-init will automatically
take care of that when it copies the servicedirs over to the /run
filesystem.

Cheers,
Luis Ressel 


pgpGsD2CDOyj_.pgp
Description: OpenPGP digital signature


Re: Improving http://skarnet.org/software/s6-rc/why.html

2016-02-26 Thread Luis Ressel
On Thu, 25 Feb 2016 14:12:29 -0500
Steve Litt <sl...@troubleshooters.com> wrote:

> Process Grand Supervisor
>  |
>  `Process Supervisor (many)
>|
>`Process (1, or 2 if there's a ./log)

The remark about logging is incorrect, at least for s6. If an s6
service is logged, the process tree will look like this:

s6-svscan
 |
 `- s6-supervise
 |   |
 |   `- service
 |
 `- s6-supervise
 |
 `- s6-log

i.e. the logger is a completely independent process supervised by its
own supervisor. An s6-supervise instance never monitors multiple
processes.

> [...]
> There are two kinds of services:
> 
> * Oneshot services
> * Long-run services
> 
> These phrases are crystal clear and have been used forever in this
> community. One could also make the point that there could be
> foreground services: I'll worry about that later.

What exactly do you mean by "foreground service" here?

By the way, I agree that trying to make supervision suites (and s6 in
particular) more accessible is a worthy goal.

-- 
Regards,
Luis Ressel