From 96fbd74d6d70b562f45e327eeb0f625b54899bcc Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 4 Jul 2015 01:40:10 +0000 Subject: Start of doc --- doc/index.html | 142 +++++++++++++++++++++++++ doc/overview.html | 220 ++++++++++++++++++++++++++++++++++++++ doc/s6-rc-compile.html | 163 +++++++++++++++++++++++++++++ doc/s6-rc-db.html | 134 ++++++++++++++++++++++++ doc/s6-rc-dryrun.html | 64 ++++++++++++ doc/s6-rc-init.html | 168 ++++++++++++++++++++++++++++++ doc/s6-rc-upgrade.html | 174 +++++++++++++++++++++++++++++++ doc/s6-rc.html | 2 +- doc/upgrade.html | 28 +++++ doc/why.html | 278 +++++++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 1372 insertions(+), 1 deletion(-) create mode 100644 doc/index.html create mode 100644 doc/overview.html create mode 100644 doc/s6-rc-compile.html create mode 100644 doc/s6-rc-db.html create mode 100644 doc/s6-rc-dryrun.html create mode 100644 doc/s6-rc-init.html create mode 100644 doc/s6-rc-upgrade.html create mode 100644 doc/upgrade.html create mode 100644 doc/why.html diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..543b4ca --- /dev/null +++ b/doc/index.html @@ -0,0 +1,142 @@ + + + + + + s6-rc - a service manager for s6 + + + + + + +

+Software
+skarnet.org +

+ +

s6-rc

+ +

What is it ?

+ +

+ s6-rc is a service manager for +s6-based +systems, i.e. a suite of programs that can start and stop +services, both long-running daemons and one-time +initialization scripts, in the proper order according to a +dependency tree. It ensures that long-running daemons are +supervised by the s6 infrastructure, and that one-time +scripts are also run in a controlled environment. +

+ +
+ + + +
+ +

Installation

+ +

Requirements

+ + + +

Licensing

+ +

+ s6-rc is free software. It is available under the +ISC license. +

+ +

Download

+ + + +

Compilation

+ + + +

Upgrade notes

+ + + +
+ +

Reference

+ +

Commands

+ +

+ All these commands exit 111 if they encounter a temporary error, and +100 if they encounter a permanent error - such as a misuse. +

+ +

Offline tools: creating and managing a compiled service database

+ + + +

Online tools: managing your live services

+ + + +

Related resources

+ +

Discussion

+ + + +

Similar work

+ + + +

Discussion

+ + + + + diff --git a/doc/overview.html b/doc/overview.html new file mode 100644 index 0000000..fd544a7 --- /dev/null +++ b/doc/overview.html @@ -0,0 +1,220 @@ + + + + + + s6-rc: an overview + + + + + + +

+s6-rc
+Software
+skarnet.org +

+ +

An overview of s6-rc

+ +

A manager for services

+ +

+ s6-rc is a service manager, or, in other words, a +machine state manager: given a database of services, +with dependencies between them, it can safely bring the +global machine state, or live state, to +the desired point, making sure dependencies are never +broken. +

+ +

The live state

+ +

+ The live state, by definition, is the tuple of +all service states on the machine. Changing the live state +means bringing services up, or bringing services down. +

+ +

2.5 kinds of services

+ +

+ Supervision suites manage long-lived processes, a.k.a +daemons, and sometimes call them services. +With s6-rc, those things are different: a long-lived process is +also called a longrun and is a service, but a service +does not have to be a longrun. There is a second kind of service, +which is called a oneshot, and which represents a change +of system state that is not embodied by the presence of a +long-lived process. For instance, "mounting a filesystem" is a +system state change, but in most cases there is no process hanging +around while the filesystem is mounted. +

+ +

+ s6-rc handles both oneshots and longruns. +

+ + + +

+ Services can depend on one another. +If service A has been declared as +depending on service B, then s6-rc will make sure to +never start A until it knows that B is up, +and will make sure to never stop B until it knows that +A is down. This works whether A and B +are both oneshots, both longruns, or a oneshot and a longrun. +

+ +

+ s6-rc also handles an additional kind of service: a bundle. +A bundle is just a collection of oneshots or longruns, described +under a single name. A bundle definition can even contain other +bundles, but ultimately a bundle will always represent a set of one +or more oneshots or longruns. A oneshot or longrun is called an +atomic service. +Bundle names can be used anywhere with the s6-rc user +interface, and they will internally be converted to a set of +atomic services. An atomic service can depend on a bundle: it will +simply depend on all the atomic services represented by the bundle. +A bundle, however, cannot have dependencies. +

+ +

A two-part operation

+ +

+ Unlike other service managers such as +anopa, s6-rc separates the +work of analyzing a set of service definitions, resolving +dependencies, and so on, from the work of actually applying the +dependency graph to perform live state changes. The former is +the compilation phase, and is done offline; the latter is +the live phase, and is of course done online - it impacts +the actual state of the machine. +

+ +

The compilation phase

+ + + +

The live phase

+ +

+ When the machine boots up: +

+ + + +

Other state changes and shutdown

+ +

+ The administrator can make changes to the live state of the machine +by manually calling s6-rc again with the +proper arguments. This is more powerful than the old +runlevels: +it is possible to change the live state to any set of +services, not only predefined ones. The only thing that s6-rc will +not allow is a state that would break service dependencies; it +will always respect the dependency graph. +

+ +

+ The s6-rc command is the central for machine state changes, and it is +also true for shutdown. When shutting a machine down, all the services +managed by s6-rc should be brought down in the proper order (via the +s6-rc -da change command). Once all those services have been +brought down successfully, the final shutdown procedure can take place; +for instance, if s6-svscan is running as process 1 with the +s6-linux-init +defaults, s6-svscanctl -t /run/service will kill the +supervision tree and call /etc/rc.shutdown reboot, which should +reboot the machine. +

+ +

Live updates to the service database

+ +

+The s6-rc command is a one-stop shop for service management as long as +the compiled database doesn't change. If an administrator wishes to +make a new compiled database the current live one, without rebooting +the machine, a bit more work is needed, and that's the job of the +s6-rc-update command. This command +has been specifically written with Unix distributions in mind: when +new packages ship, they come with new service definitions, or upgraded +ones, and it is necessary to compile a new service database and update +the live state so it matches; if source definitions for s6-rc are +provided in the packages, an invocation of +s6-rc-compile followed by an invocation of +s6-rc-update should be all it takes to +keep the live state up to date. +

+ + + diff --git a/doc/s6-rc-compile.html b/doc/s6-rc-compile.html new file mode 100644 index 0000000..33d8bcd --- /dev/null +++ b/doc/s6-rc-compile.html @@ -0,0 +1,163 @@ + + + + + + s6-rc: the s6-rc-compile program + + + + + + +

+s6-rc
+Software
+skarnet.org +

+ +

The s6-rc-compile program

+ +

+ s6-rc is a machine state manager: it brings the machine to a +desired state, by starting or stopping services as needed. +

+ +

Interface

+ +
+     s6-rc [ -v verbosity ] [ servicenames... ]
+
+ + + +

Options

+ +

s6-rc control

+ + + +

Up or down

+ + + +

Service selection

+ + + +

Actions

+ + + +

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

+ + + diff --git a/doc/s6-rc-db.html b/doc/s6-rc-db.html new file mode 100644 index 0000000..9a1cf3b --- /dev/null +++ b/doc/s6-rc-db.html @@ -0,0 +1,134 @@ + + + + + + s6-rc: the s6-rc-db program + + + + + + +

+s6-rc
+Software
+skarnet.org +

+ +

The s6-rc-db program

+ +

+ s6-rc-db is a tool to analyze a compiled service database +and extract information from it, and print it in a user-friendly +format. +

+ +

+ It is an offline tool, i.e. you can run it on any +compiled service database without actually having a live set +of services managed by s6-rc. However, if you do have a live +set, you can still run s6-rc-db on the current database (and +it is the default); it won't interfere with your normal service +operation. +

+ +

Interface

+ +
+     s6-rc-db help
+     s6-rc-db [ -l live ] [ -c compiled ] check
+     s6-rc-db [ -l live ] [ -c compiled ] list all|services|oneshots|longruns|bundles
+     s6-rc-db [ -l live ] [ -c compiled ] type servicename
+     s6-rc-db [ -l live ] [ -c compiled ] [ -u | -d ] timeout atomicname
+     s6-rc-db [ -l live ] [ -c compiled ] contents bundlename
+     s6-rc-db [ -l live ] [ -c compiled ] [ -u | -d ] dependencies servicename
+     s6-rc-db [ -l live ] [ -c compiled ] servicedir longrunname
+     s6-rc-db [ -l live ] [ -c compiled ] [ -u | -d ] script oneshotname
+     s6-rc-db [ -l live ] [ -c compiled ] flags atomicname
+     s6-rc-db [ -l live ] [ -c compiled ] atomics servicename...
+     s6-rc-db [ -l live ] [ -c compiled ] [ -u | -d ] all-dependencies servicename...
+
+ + + +

Options

+ + + +

Subcommands

+ +

s6-rc-db help

+ +

+ Prints a help message on stdout. +

+ +

s6-rc-db check

+ +

+ Checks the database consistency. Exits 4 with an error message if +it finds a problem, such as a mismatch in the direct and reverse +dependency tables, or a dependency cycle. +

+ + +

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

+ + + diff --git a/doc/s6-rc-dryrun.html b/doc/s6-rc-dryrun.html new file mode 100644 index 0000000..0a55fa6 --- /dev/null +++ b/doc/s6-rc-dryrun.html @@ -0,0 +1,64 @@ + + + + + + s6-rc: the s6-rc-dryrun program + + + + + + +

+s6-rc
+Software
+skarnet.org +

+ +

The s6-rc-dryrun internal program

+ +

+ s6-rc-dryrun is a command wrapper and nullifier, roughly +equivalent to the Unix echo command. When run, it +simply prints its arguments to stdout. +

+ +

+ s6-rc-dryrun is not meant to be used directly; it is +internally called by +s6-rc when given the -n +option. When a dry-running s6-rc instance wants to change the +system state by spawning a command cmd, it spawns +s6-rc-dryrun cmd instead, which allows the user +to see what would have been done without actually running the +command. +

+ +

Interface

+ +
+     s6-rc-dryrun [ -v verbosity ] [ -t timeout ] cmd...
+
+ + + +

Options

+ + + + + diff --git a/doc/s6-rc-init.html b/doc/s6-rc-init.html new file mode 100644 index 0000000..143a0f4 --- /dev/null +++ b/doc/s6-rc-init.html @@ -0,0 +1,168 @@ + + + + + + s6-rc: the s6-rc-init program + + + + + + +

+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... ]
+
+ + + +

Options

+ +

s6-rc control

+ + + +

Up or down

+ + + +

Service selection

+ + + +

Actions

+ + + +

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

+ + + diff --git a/doc/s6-rc-upgrade.html b/doc/s6-rc-upgrade.html new file mode 100644 index 0000000..bdaa090 --- /dev/null +++ b/doc/s6-rc-upgrade.html @@ -0,0 +1,174 @@ + + + + + + s6-rc: the s6-rc-update program + + + + + + +

+s6-rc
+Software
+skarnet.org +

+ +

The s6-rc-update program

+ +

+ s6-rc-update is an online service database switcher: +it will replace your compiled service database with another +one, and adjust the live state accordingly. +

+ +

+ Live upgrading a service database is no small feat, and no +fully automated system can get it right in all cases. +s6-rc-update will do its best on its own, but it lets you +give it instructions to handle +difficult cases; and rather than implement doubtful +heuristics, it will fail with an error message in +situations it really cannot solve. +

+ +

Interface

+ +
+     s6-rc [ -v verbosity ] [ servicenames... ]
+
+ + + +

Options

+ +

s6-rc control

+ + + +

Up or down

+ + + +

Service selection

+ + + +

Actions

+ + + +

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

+ + + diff --git a/doc/s6-rc.html b/doc/s6-rc.html index eeefe7a..34dfc59 100644 --- a/doc/s6-rc.html +++ b/doc/s6-rc.html @@ -26,7 +26,7 @@ desired state, by starting or stopping services as needed.

Interface

-     s6-rc [ -v verbosity ] [servicenames...
+     s6-rc [ -v verbosity ] [ servicenames... ]