How to use s6 and s6-rc together

2017-05-18 Thread Robert Hill
Hello list,

I have read the documentation for s6 and s6-rc at skarnet.org, but I
am having a little trouble understanding the fundamentals of how to get my
Slackware box running using it as both the init, process supervisor, and
service manager. (I am still in the exploratory stages of this project; I
am trying to plan out what my strategy will be before I jump in. My
eventual goal will be to provide Slackbuild scripts for these packages and
dependencies for ease of installation on Slackware, although it will be my
first attempt at creating Slackbuilds.)

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.

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)?

Thanks,

Robert Hill


Re: How to use s6 and s6-rc together

2017-05-19 Thread Robert Hill
On Thu, May 18, 2017 at 5:02 PM, Luis Ressel  wrote:

> ​>​
> ​ ​
> 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
> ​>​
> ​o​
> nce 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).
>

​Ah, I see my error was assuming that scandirs were static for the life of
the current boot, rather than having service directories symlinked in.​

​
Thanks for the help.