Re: rc-init misunderstanding dependencies files

From: Colin Booth <cathexis_at_gmail.com>
Date: Sun, 1 May 2016 00:43:06 -0700

On Sat, Apr 30, 2016 at 10:39 PM, Eric Vidal <eric_at_obarun.org> wrote:
>
> Hello,
>
> Can you explain me what means the 00 in some dependencies files on your examples providen by s6 packages, please?
Within the examples, 00 is the root service that all other services
depend on. Either through an explicit dependency call (like
mount-proc) or through a bundle dependency (anything depending on
ok-local will transitively depend on 00 since an explicit dependency
on a bundle is an implicit dependency on every member of that bundle)
>
> If i understand correctly the first line/name is read AND executed before read AND execute the second line.
> I mean if i have a file dependencies like this :
> mount-proc
> mount-sys
>
> when rc-init read the file dependencies, it launch the service mount-proc first, wait for the exit code then launch the second service mount-sys, right?
A slight correction, rc-init doesn't run anything, it handles
preparing the service tree. s6-rc change $SERVICE does the actual
work. When s6-rc-compile packs the compiled form of the service
directory it creates a stable ordering based on the dependency
callouts. In the case of two services with equal weight (like if
longrunA depends on oneshot1 and oneshot2, and both oneshots have no
dependencies), s6-rc will run both nominally in parallel when it comes
time to bring up the supervision tree. The only way to get the
ordering that you describe, where s6-rc launches one service and then
waits for the exit code before launching the second, is to have an
explicit dependency called out in the second service.
>
> With this principle i can decide what service need to start first an another or after an another, right?
For the most part yes. You can't have a service that says that it
needs to run before another, but a dependency callout will guarantee
that the listed services are started before the service defining those
dependencies.
>
> Eric Vidal
Cheers!


-- 
"If the doors of perception were cleansed every thing would appear to
man as it is, infinite. For man has closed himself up, till he sees
all things thru' narrow chinks of his cavern."
  --  William Blake
Received on Sun May 01 2016 - 07:43:06 UTC

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