s6-rc
Software
skarnet.org
The s6-rc-init program
s6-rc-init is an initialization tool for the s6-rc
system. It must be run at boot time, prior to any
invocation of the
s6-rc binary.
Requirements
Interface
s6-rc-init [ -v verbosity ] [ servicenames... ]
- s6-rc expects to find a compiled service database
in /etc/s6-rc/compiled and a live state in
/s6/s6-rc. If it cannot find that data, it complains and
exits.
- The compiled service database is built offline
via the s6-rc-compile tool.
- The live state should be initialized at boot time
via the s6-rc-init tool. It is then
maintained by s6-rc itself.
- The command line arguments servicenames... define a set
of selected services the user wants to act on.
- s6-rc computes the necessary transitions to bring the machine
to the desired state - by default a state where all the
services listed on the command line are up. If asked to, it performs
those transitions.
- s6-rc processes services as soon as they can be processed. It
will wait until a service is up to start a dependent service, but it
will start two independent services in parallel.
- If every state transition completes successfully, s6-rc exits 0.
- If a state transition fails, s6-rc will not perform the transitions
that depend on it. It will wait until all the other independent transitions
are done, then exit 1.
Options
s6-rc control
- -v verbosity : be more or less
verbose. Default is 1: warning and error messages will be printed to
stderr. 0 silences warnings. 2 writes information messages whenever
s6-rc performs a transition. 3 or more is debug info.
- -n dryruntimeout : dry run.
s6-rc will pretend to perform transitions, but will replace all its
program invocations by a call to
s6-rc-dryrun, which will do nothing but
print the command line s6-rc would have executed, then sleep for
dryruntimeout milliseconds before reporting success.
- -t timeout : timeout. If s6-rc
isn't done after timeout milliseconds, it will exit, leaving
the live state as it is at exit time. It does not kill its children, so
a child may successfully complete afterwards and the live state will
not be updated; in that case, subsequent s6-rc invocations will notice
and correctly update it.
- -c compiled : look for the
compiled service database in compiled. Default is
/etc/s6-rc/compiled
- -l live : look for the
live state in live. Default is
/s6/s6-rc
Up or down
- -u : selected services are interpreted
as to be brought up. This is the default.
- -d : selected services are interpreted
as to be brought down.
Service selection
- -p : prune. The state will be brought to
exactly servicenames..., plus their dependencies, and
the other services will be brought down. With the -d option,
the meaning is reversed: the state will be brought to the maximum
possible set that does not include servicenames....
- -a : all. Add the current set of active services to
the selected set. This is useful to ensure consistency of the machine
state, for instance, and also at shutdown time: s6-rc -da
will stop all the currently active services.
Actions
- -C : check. s6-rc will check the consistency of the
database, and exit with an error message if it finds errors.
- -L : list. s6-rc will resolve the given names, then
print the list of corresponding atomic services to stdout, without taking their
dependencies into account. It will print an empty line afterwards.
- -A : list all. s6-rc will print the list of selected
atomic services to stdout, after computing dependencies. Note that with
the -d option, it computes reverse dependencies instead.
- -S : state change. A state change will be performed
for the selected services.
This is the default if no other action option has been given.
Usage examples
s6-rc myservicebundle
Brings up all the services represented by myservicebundle,
dependencies first.
s6-rc -Sad
Brings down all the services in an orderly manner. This is typically
run at shutdown time.
s6-rc -Au myservicebundle
Prints the names of all atomic services represented by
myservicebundle, as well as everything they depend on.
s6-rc -Ad myservicebundle
Prints the names of all atomic services represented by
myservicebundle, as well as everything that depends on them.
s6-rc -pun0 myservicebundle
Prints what s6-rc would do to bring the state to just
myservicebundle and its dependencies.
Internals