From c2740b983f6bb4baf0d5a1772fa3682cc66aa5f9 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 18 Jan 2026 02:50:51 +0000 Subject: Add s6 live install --init ; finish and fix documentation --- doc/index.html | 6 + doc/overview.html | 316 +++++++++++++++++++++++++++++++++++++++ doc/s6-frontend-helper-kill.html | 8 +- doc/s6-frontend.conf.html | 9 +- doc/s6-frontend.html | 8 +- doc/s6.html | 59 ++------ doc/s6_live.html | 52 +++---- doc/s6_process.html | 32 +--- doc/s6_repository.html | 28 +--- doc/s6_set.html | 46 ++---- doc/s6_system.html | 68 +++++---- 11 files changed, 429 insertions(+), 203 deletions(-) create mode 100644 doc/overview.html (limited to 'doc') diff --git a/doc/index.html b/doc/index.html index d7d20b3..2d408b9 100644 --- a/doc/index.html +++ b/doc/index.html @@ -72,6 +72,12 @@ parts of an s6-based system.
+ + +
+

Installation

Requirements

diff --git a/doc/overview.html b/doc/overview.html new file mode 100644 index 0000000..f4d16f7 --- /dev/null +++ b/doc/overview.html @@ -0,0 +1,316 @@ + + + + + + s6-frontend: overview + + + + + + +

+s6-frontend
+Software
+skarnet.org +

+ +

s6-frontend: an overview

+ +

Contents of the s6-frontend package

+ +

+ The s6-frontend package does not itself contain much. The only binary +that users will interact with directly is the +s6 binary, which is a wrapper around the +s6-frontend binary (which users +should not have to call directly), which is itself a wrapper around +various commands of the s6 ecosystem that users also need to have +installed in order for s6-frontend to work. That means: +

+ + + +

Installing s6-frontend

+ +

+ In addition to the s6-frontend package and its dependencies, in order to +make use of the s6 command, you will need +service definitions: a set of directories, in a format understandable +by s6-rc-compile, +describing various services that can run on a machine — long-running +daemons, one-shot scripts, and "bundles" aliasing to a group of these services. +

+ +

+ If you are running s6-frontend from a distribution, the packages that provide +these services should already have them defined, and the service definition +directories should already made available in some pre-configured +stores. Your +distribution should also have pre-installed everything you need in order +for yo to be able to use the s6 command to +control the system. But if you are installing s6-frontend manually, or are +the person building the distribution, here is what you need to do: +

+ + + + +

Concepts

+ +

+ s6-frontend does not come with any innovating concepts — it's just a series +of user-friendly wrappers around various commands in the s6 ecosystem, hiding +the details of various options and installation directories. For instance: +

+ + + +

+ The most innovating change comes from the +repo commands, in the +version of s6-rc that is released at the +same time as the first release of s6-frontend. The goals of the repo commands, which +are wrapped by the s6 repository and +s6 set commands, are: +

+ + + +

Comparison with OpenRC

+ +

+ One of the design goals of s6-frontend is to provide a user interface to service +management that is comparable to the one provided by OpenRC. +

+ +

+ A fundamental difference between s6-frontend and OpenRC is that OpenRC always +works on live services, the ones that are currently running on the +user's machine. It only has one live database, comprising several +"runlevels" (sets of services meant to be run together), and manages its +dependency tree dynamically. +

+ +

+ s6-frontend, on the other hand (and more accurately, this is the domain of +the s6-rc service manager and its +repo commands), +separates the notion of live database and of working set +entirely. The working set is worked on offline, without +impacting the current machine state. You can start and stop +live services, but you can only enable or disable +— or mask — services on the working set. Enabling a +service means that next time you boot on the service database you are +working on, that service will be automatically started.
+ Once you have worked on a set of services, you can replace the live +database with it; the old live database disappears entirely, and your +working set (well, a copy of it) is now live. +

+ +

+ A corollary of that is that s6-frontend does not have runlevels. It does +not need them. The default bundle specifies what services should +be started at boot; other bundles (in the sense of s6-rc) can be defined +in the stores, and the user can start and stop them at will, as well as +start and stop individual services, dependencies notwithstanding. By +default, all the services are accessible in the live database, but the +user can choose to exclude certain services by masking them in +a working set and then installing that set. +

+ +

+ These differences being given, s6-frontend should be very comparable to +OpenRC in its everyday usage. Here is a table showing some correspondences; +it is not meant to be exhaustive, but to show a representative enough sample +of the kind of commands that can be worked with. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OpenRC command s6-frontend equivalent Notes
rc-service foobar start s6 live start foobar Starts a service in the live database.
rc-service foobar status s6 live status foobar or s6 process status foobar s6 process status foobar only works if foobar is a longrun, +in which case it will give detailed information on its supervised instance.
rc-status default s6 live status or s6 set status s6 live status shows the status of the current live database, +s6 set status the status of the offline working set.
rc-update add foobar s6 set enable foobar See below.
rc-update del foobar s6 set disable foobar See below.
rc-update show s6 set status Shows the enabled, disabled and masked services, but to make the +changes effective, the user needs to run s6 set commit then +s6 live install.
openrc sysinit && openrc boot && openrc default s6 system boot The existence of the sysinit and boot runlevels are a +historical wart that OpenRC still has to deal with; s6-frontend does not.
reboot reboot or s6 system reboot Just like OpenRC's reboot command will only work if the system +is using openrc-init, s6 system reboot command will only work +if the system is using s6-linux-init.
+ + + diff --git a/doc/s6-frontend-helper-kill.html b/doc/s6-frontend-helper-kill.html index 6c5d2b8..e32840c 100644 --- a/doc/s6-frontend-helper-kill.html +++ b/doc/s6-frontend-helper-kill.html @@ -27,9 +27,7 @@ although nothing bad will happen if you do. It is used in command lines crafted program, because the latter does not support sending arbitrary numerical signals.

-
-

Interface

-
+

Interface

      s6-frontend-helper-kill sig pids...
@@ -41,9 +39,7 @@ of one or more integers, pids..., on its command line. 
  
  • It sends signal number sig to all the processes listed as pids....
  • -
    -

    Exit codes

    -
    +

    Exit codes

    0
    Success
    diff --git a/doc/s6-frontend.conf.html b/doc/s6-frontend.conf.html index fbf284c..6d06601 100644 --- a/doc/s6-frontend.conf.html +++ b/doc/s6-frontend.conf.html @@ -18,9 +18,7 @@

    The /etc/s6-frontend.conf configuration file

    -
    -

    Goal and usage

    -
    +

    Goal and usage

    /etc/s6-frontend.conf is a configuration file provided by the @@ -38,9 +36,7 @@ are located). what the full path to the foobar service directory is.

    -
    -

    Description

    -
    +

    Description

    The /etc/s6-frontend.conf file follows the syntax of the @@ -57,7 +53,6 @@ simple key = value lines, comments permitted.

    -
    scandir
    The directory where s6-svscan is running. diff --git a/doc/s6-frontend.html b/doc/s6-frontend.html index e8d8f56..df6b913 100644 --- a/doc/s6-frontend.html +++ b/doc/s6-frontend.html @@ -24,17 +24,13 @@ the s6 command line. It is not meant to be called directly users should call s6 instead.

    -
    -

    Interface

    -
    +

    Interface

          s6-frontend [ global_options... ] command subcommand [ subcommand_options... ] [ args... ]
     
    -
    -

    Detailed operation

    -
    +

    Detailed operation

    What really happens when you call s6 args... is the following: diff --git a/doc/s6.html b/doc/s6.html index 775a09d..8aec603 100644 --- a/doc/s6.html +++ b/doc/s6.html @@ -26,9 +26,7 @@ interact with a system managed by the s6-linux-init boot program.

    -
    -

    Interface

    -
    +

    Interface

          s6 [ global_options... ] command subcommand [ subcommand_options... ] [ args... ]
    @@ -44,16 +42,7 @@ various parts of the s6 ecosystem, depending on the given command and
     subcommand. 
     
     
    -
    -

    Common usage

    -
    - -

    -

    - -
    -

    Exit codes

    -
    +

    Exit codes

    s6 always exits 0 on success, 100 on bad usage, and 111 on a system call @@ -73,9 +62,7 @@ command, and on the linked documentation page, you can find the interpretation of its various exit codes.

    -
    -

    Environment variables

    -
    +

    Environment variables

    • s6 reads the S6_FRONTEND_CONF environment variable. This @@ -86,9 +73,7 @@ possibly overridden by the --conffile build-time configure option to s6-frontend.
    -
    -

    Global options

    -
    +

    Global options

    global_options... is a list of options that modify s6's behaviour @@ -164,13 +149,9 @@ have built s6-frontend with util-linux support.

    -
    -

    Commands

    -
    +

    Commands

    -
    -

    help

    -
    +

    help

    s6 help prints a short help message summarizing the options @@ -181,9 +162,7 @@ and usage of the s6 command. It is not as detailed as this page. No subcommands are defined.

    -
    -

    version

    -
    +

    version

    s6 version prints the current version of s6-frontend, on one line. @@ -193,9 +172,7 @@ and usage of the s6 command. It is not as detailed as this page. No subcommands are defined.

    -
    -

    process

    -
    +

    process

    s6 process sends commands to long-running processes supervised by the @@ -209,9 +186,7 @@ needs to be restarted or otherwise addressed without involvement from the servic manager, i.e. without having to start or stop dependencies.

    -
    -

    live

    -
    +

    live

    s6 live controls the live state of the machine, starting and stopping @@ -221,9 +196,7 @@ around the available here.

    -
    -

    repository

    -
    +

    repository

    s6 repository regroups administrative tasks related to the repository @@ -237,9 +210,7 @@ the initial layout, run their package manager, etc. The details are available here.

    -
    -

    set

    -
    +

    set

    s6 set is the interface to the creation and manipulation of service sets by @@ -251,9 +222,7 @@ the live state of the machine, accessible via s6 livehere.

    -
    -

    system

    -
    +

    system

    s6 system provides commands to run at boot and, on systems fully managed by s6, @@ -261,9 +230,7 @@ to shut the system down. The details are available here.

    -
    -

    Notes

    -
    +

    Notes

    • s6 does not perform real operations itself. Instead, after diff --git a/doc/s6_live.html b/doc/s6_live.html index cd6aeac..3e121ec 100644 --- a/doc/s6_live.html +++ b/doc/s6_live.html @@ -33,30 +33,22 @@ without knowledge of the service manager, and thus can only address longruns, as well as longruns, and always respects the dependency graph.

      -
      -

      Interface

      -
      +

      Interface

            s6 live subcommand [ subcommand_options... ] [ args... ]
       
      -
      -

      Subcommands

      -
      +

      Subcommands

      -
      -

      help

      -
      +

      help

      s6 live help prints a short help message summarizing the options and usage of the s6 live command. It is not as detailed as this page.

      -
      -

      status

      -
      +

      status

      Interface

      @@ -89,9 +81,7 @@ This is the default.
      List all services, including essential ones.
    -
    -

    start

    -
    +

    start

    Interface

    @@ -118,9 +108,7 @@ transitions. By default, timeout is 0, meaning infinite: the command can wait forever. -
    -

    stop

    -
    +

    stop

    Interface

    @@ -147,9 +135,7 @@ transitions. By default, timeout is 0, meaning infinite: the command can wait forever. -
    -

    restart

    -
    +

    restart

    Interface

    @@ -180,9 +166,7 @@ transitions. By default, timeout is 0, meaning infinite: the command can wait forever. -
    -

    start_everything

    -
    +

    start_everything

    Interface

    @@ -217,9 +201,7 @@ The default is default, possibly overridden by the s6-frontend. -
    -

    stop_everything

    -
    +

    stop_everything

    Interface

    @@ -259,14 +241,12 @@ transitions. By default, timeout is 0, meaning infinite: the command can wait forever. -
    -

    install

    -
    +

    install

    Interface

    -     s6 live install [ -b ] [ -K ] [ -f convfile ]
    +     s6 live install [ -b ] [ -K ] [ -f convfile ] [ --init ]
     
    -
    -

    check

    -
    +

    check

    Interface

    @@ -156,9 +144,7 @@ depends on service B and A is unmasked or enabled, change B to be unmasked or enabled as well. -
    -

    sync

    -
    +

    sync

    Interface

    diff --git a/doc/s6_set.html b/doc/s6_set.html index 83cf9f7..fd20775 100644 --- a/doc/s6_set.html +++ b/doc/s6_set.html @@ -21,8 +21,8 @@

    s6 set regroups actions on -service sets, +telling the service manager what services should be enabled or disabled at boot time, or even should be masked, i.e. should not even appear in the list of services available at next boot.

    @@ -40,30 +40,22 @@ which is internally named current. It is not the set that is currently live; it is the set that is currently worked on.

    -
    -

    Interface

    -
    +

    Interface

          s6 set subcommand [ subcommand_options... ] [ args... ]
     
    -
    -

    Subcommands

    -
    +

    Subcommands

    -
    -

    help

    -
    +

    help

    s6 set help prints a short help message summarizing the options and usage of the s6 set command. It is not as detailed as this page.

    -
    -

    save

    -
    +

    save

    Interface

    @@ -74,7 +66,7 @@ and usage of the s6 set command. It is not as detailed as this page.

    Options

    @@ -85,9 +77,7 @@ set named name. of the current working set. By default, the command exits with an error instead of overwriting. -
    -

    load

    -
    +

    load

    Interface

    @@ -101,9 +91,7 @@ as name.
  • No options are defined.
  • -
    -

    list

    -
    +

    list

    Interface

    @@ -128,9 +116,7 @@ default.
    Do not list essential services.
    -
    -

    list

    -
    +

    status

    Interface

    @@ -188,7 +174,7 @@ default.
    -

    enable, disable, mask, unmask, make-essential

    +

    enable, disable, mask, unmask, make-essential

    Interface

    @@ -223,7 +209,7 @@ make the set inconsistent.
    Do not perform the change; only show what would be done and check whether the set would be made inconsistent.
    -
    -I what, --if-dependencies-found=what
    +
    -I what, --if-dependencies-found=what
    What to do when services have dependencies, or reverse dependencies, that are not listed in services.... what can be fail, warn, or pull. @@ -248,9 +234,7 @@ allow the user to tailor the boot sequence to their needs without touching the currently running database.

    -
    -

    check

    -
    +

    check

    Interface

    @@ -294,9 +278,7 @@ depends on service B and A is unmasked or enabled, change B to be unmasked or enabled as well.
    -
    -

    commit

    -
    +

    commit

    Interface

    diff --git a/doc/s6_system.html b/doc/s6_system.html index 10d52d7..a226a27 100644 --- a/doc/s6_system.html +++ b/doc/s6_system.html @@ -24,9 +24,7 @@ the system.

    -
    -

    Interface

    -
    +

    Interface

          s6 system subcommand
    @@ -36,22 +34,16 @@ the system.
      
  • No subcommand takes any options.
  • -
    -

    Subcommands

    -
    +

    Subcommands

    -
    -

    help

    -
    +

    help

    s6 system help prints a short help message summarizing the options and usage of the s6 system command. It is not as detailed as this page.

    -
    -

    boot

    -
    +

    boot

    Interface

    @@ -68,18 +60,40 @@ a state where everything the user wants is running. program hands off duties.
    • On a system making use of -s6-linux-init/a>, -s6 system boot should be the sole command defined in the -/etc/rc.init script.
    • -
    • On a system using /etc/inittab, the first line -of the inittab should be: ::wait:/usr/bin/s6 system boot
    • +
      s6-linux-init, +s6 system boot should be run by the +/etc/rc.init script. No other command needs to appear in +that script. +
    • On a system using /etc/inittab, you need to add +two lines at the beginning of /etc/inittab: +
        +
      • The first line should be a command that runs and respawns +s6-svscan, +ideally with a catch-all logger. This could be something like +::respawn:/usr/lib/s6/s6-svscanboot, with /usr/lib/s6/s6-svscanboot +being similar to the script used +in +Alpine Linux to start an instance of s6-svscan supervising its own +catch-all logger.
      • +
      • The second line should be ::wait:/usr/bin/s6 system boot.
      • +
      • For complete safety, there should be a synchronization mechanism so +that the second line never starts before s6-svscan is ready. A quick and (very) dirty +way to synchronize is polling on s6-svscan before running the +command: ::wait:until s6-svscanctl /run/service 2>/dev/null; do :; done && exec /usr/bin/s6 system boot
      • +
    • +
    • It is also possible to run a complete s6 ecosystem under systemd, but it is redundant, +so it's unlikely that anyone would want to do it. For the sake of completeness, +the way would be to define two unit files: the first one to launch s6-svscan, as +documented here, +and the second one, specified to run after the first one, to run +the s6 system boot command as a one-shot.

    The rest of the subcommands are shutdown subcommands, and they only work if the machine makes use of -s6-linux-init/a> and +s6-linux-init and s6-frontend has been configured to support it. On a machine that does not boot via s6-linux-init, a shutdown should be executed via the shutdown commands provided by your init system. In order for @@ -90,9 +104,7 @@ following line should appear in /etc/inittab: ::shutdown:/usr/bin/s6 live stop_everything -E

    -
    -

    reboot

    -
    +

    reboot

    Interface

    @@ -103,13 +115,11 @@ following line should appear in /etc/inittab: -
    -

    poweroff

    -
    +

    poweroff

    Interface

    @@ -121,13 +131,11 @@ s6-frontend has been configured to support it.
  • s6 system poweroff halts the system and turns the power off.
  • This only works if the machine makes use of -s6-linux-init/a> and +s6-linux-init and s6-frontend has been configured to support it.
  • -
    -

    halt

    -
    +

    halt

    Interface

    @@ -139,7 +147,7 @@ s6-frontend has been configured to support it.
  • s6 system halt halts the system without turning the power off.
  • This only works if the machine makes use of -s6-linux-init/a> and +s6-linux-init and s6-frontend has been configured to support it.
  • -- cgit v1.3.1