From 16a8a828163dc2344466fabbe7b2ae0383a033c2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 16 Jun 2026 01:52:00 +0000 Subject: s6_set changes: configurable set, remove load/save, add copy Also add a configurable set to s6_live_install Don't unlist current in s6_repository_list --- doc/overview.html | 10 ++-- doc/s6_live.html | 45 ++++++++------- doc/s6_repository.html | 6 +- doc/s6_set.html | 100 +++++++++++++++++---------------- src/s6-frontend/live_install.c | 5 +- src/s6-frontend/repository_list.c | 4 +- src/s6-frontend/s6-frontend-internal.h | 3 +- src/s6-frontend/set.c | 3 +- src/s6-frontend/set.help.txt | 22 +++++--- src/s6-frontend/set_change.c | 50 +++++++---------- src/s6-frontend/set_check.c | 15 ++++- src/s6-frontend/set_commit.c | 7 ++- src/s6-frontend/set_copy.c | 65 +++++++++------------ src/s6-frontend/set_delete.c | 6 +- src/s6-frontend/set_list.c | 15 ++++- src/s6-frontend/set_status.c | 15 ++++- 16 files changed, 201 insertions(+), 170 deletions(-) diff --git a/doc/overview.html b/doc/overview.html index f0f45f0..cd9f338 100644 --- a/doc/overview.html +++ b/doc/overview.html @@ -226,10 +226,10 @@ dependency tree dynamically. On the other hand, s6-frontend (and, more accuratel 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 +entirely. A 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 +— or mask — services on a 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 @@ -278,17 +278,17 @@ 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. +s6 set status the status of the current offline working set. rc-update add foobar s6 set enable foobar - Enable service foobar in the offline working set. + Enable service foobar in the current offline working set. rc-update del foobar s6 set disable foobar - Disable service foobar in the offline working set. + Disable service foobar in the current offline working set. rc-update show diff --git a/doc/s6_live.html b/doc/s6_live.html index 53f3359..0af54c5 100644 --- a/doc/s6_live.html +++ b/doc/s6_live.html @@ -78,12 +78,12 @@ of the service from its state.

Options

-
-e, --without-essentials
+
-e, --without-essentials
Do not list essential services, which can clutter the display with irrelevant information and are all supposed to always be up anyway. This is the default.
-
-E, --with-essentials
+
-E, --with-essentials
List all services, including essential ones.
@@ -104,10 +104,10 @@ as well as their dependencies.

Options

-
-n, --dry-run
+
-n, --dry-run
Only print what would be done; do not actually start services.
-
-t timeout, --timeout=timeout
+
-t timeout, --timeout=timeout
If the whole change still hasn't completed after timeout milliseconds, stop waiting and don't attempt to perform the remaining transitions. By default, timeout is 0, meaning infinite: the @@ -131,10 +131,10 @@ as well as services that depends on them.

Options

-
-n, --dry-run
+
-n, --dry-run
Only print what would be done; do not actually stop services.
-
-t timeout, --timeout=timeout
+
-t timeout, --timeout=timeout
If the whole change still hasn't completed after timeout milliseconds, stop waiting and don't attempt to perform the remaining transitions. By default, timeout is 0, meaning infinite: the @@ -162,10 +162,10 @@ back up.

Options

-
-n, --dry-run
+
-n, --dry-run
Only print what would be done; do not actually stop or start services.
-
-t timeout, --timeout=timeout
+
-t timeout, --timeout=timeout
If the whole restart still hasn't completed after timeout milliseconds, stop waiting and don't attempt to perform the remaining transitions. By default, timeout is 0, meaning infinite: the @@ -189,16 +189,16 @@ the bundle of services that are enabled at boot time.

Options

-
-n, --dry-run
+
-n, --dry-run
Only print what would be done; do not actually start services.
-
-t timeout, --timeout=timeout
+
-t timeout, --timeout=timeout
If the whole change still hasn't completed after timeout milliseconds, stop waiting and don't attempt to perform the remaining transitions. By default, timeout is 0, meaning infinite: the command can wait forever.
-
-D bundle, --default-bundle=bundle
+
-D bundle, --default-bundle=bundle
Start the bundle of services named bundle instead. The default is default, possibly overridden by the --with-default-bundle build-time configure option in @@ -223,15 +223,15 @@ reboot a machine; for that, check s6 system Options
-
-n, --dry-run
+
-n, --dry-run
Only print what would be done; do not actually stop services.
-
-e, --without-essentials
+
-e, --without-essentials
Do not stop essential services; keep the machine in a state where it can more or less run and be interacted with, even if in a completely bare state. This is the default.
-
-E, --with-essentials
+
-E, --with-essentials
Also stop essential services. After this command the machine isn't good for much except a reboot. s6 live stop-everything -E is the command that should be run right before a shutdown when the @@ -239,7 +239,7 @@ system is not using s6-linux-init. To that end, the line ::shutdown:/usr/bin/s6 live stop-everything -E should be added to /etc/inittab, if that is what the init uses.
-
-t timeout, --timeout=timeout
+
-t timeout, --timeout=timeout
If the whole change still hasn't completed after timeout milliseconds, stop waiting and don't attempt to perform the remaining transitions. By default, timeout is 0, meaning infinite: the @@ -251,11 +251,11 @@ command can wait forever.

Interface

-     s6 live install [ -b ] [ -K ] [ -f convfile ] [ --init ]
+     s6 live install [ -b ] [ -K ] [ -f convfile ] [ -s setname ] [ --init ]
 
    -
  • s6 live install installs the current working set +
  • s6 live install installs the current working set of services, that has been crafted and committed via s6 set commands, replacing the current live service database.
  • @@ -267,21 +267,24 @@ stopped before the live database is replaced.

    Options

    -
    -b, --block
    +
    -b, --block
    Block if something is currently holding the lock on the live service database. The default is to fail with an error message instead.
    -
    -K, --keep-old
    +
    -K, --keep-old
    Do not automatically delete the old service database after a successful switch. Instead, print its path to stdout.
    -
    -f convfile, --conversion-file=convfile
    +
    -f convfile, --conversion-file=convfile
    Use convfile as a conversion file for the underlying s6-rc-update invocation. This option should never be necessary if the services in the stores are properly managed.
    -
    --init
    +
    -s setname, --set=setname
    +
    Install the compiled set named setname. Default is current.
    + +
    --init
    Copy the compiled database of the current working set to the place where it can be booted on, but do not call diff --git a/doc/s6_repository.html b/doc/s6_repository.html index 1d33c0b..d9cfcc9 100644 --- a/doc/s6_repository.html +++ b/doc/s6_repository.html @@ -99,9 +99,9 @@ no impact whatsoever and this option can safely be ignored.
      -
    • s6 repository list lists all the saved sets in the repository, -printing their names on stdout, one per line. It does not list current, -the current working set, which always exists.
    • +
    • s6 repository list lists all the sets in the repository, +printing their names on stdout, one per line. current is the +default working set and always exists.
    • No options are defined.
    diff --git a/doc/s6_set.html b/doc/s6_set.html index 8f0e969..bd74233 100644 --- a/doc/s6_set.html +++ b/doc/s6_set.html @@ -37,7 +37,7 @@ setting services in a state that remains theoretical until the user

    s6 set commands always operate on a "working set" of services, -which is internally named current. It is not the set that is +which is by default named current. It is not the set that is currently live; it is the set that is currently worked on.

    @@ -56,41 +56,27 @@ currently live; it is the set that is currently worked on. and usage of the s6 set command. It is not as detailed as this page.

    -

    save

    +

    copy

    Interface

    -     s6 set save [ -f ] name
    +     s6 set copy [ -f ] source dest 
     
      -
    • s6 set save saves a copy of the current working set into a -set named name.
    • -
    • name can be loaded by s6 set load name.
    • +
    • s6 set copy copies the set named source to a new set +named dest.
    • +
    • There is always at least one set named current. This is the set being +operated on by default by every s6 set command.

    Options

    -f, --force
    -
    If a set named name already exists, overwrite it with a copy -of the current working set. By default, the command exits with an error -instead of overwriting.
    - -

    load

    - -

    Interface

    - -
    -     s6 set load name
    -
    - -
      -
    • s6 set load replaces the current working set with the set stored -as name.
    • -
    • No options are defined.
    • -
    +
    If dest already exists, overwrite it with a copy of source. +By default, the command exits with an error instead of overwriting.

    delete

    @@ -102,6 +88,7 @@ as name.
    • s6 set delete deletes the saved sets named names...
    • +
    • The set named current cannot be deleted.
    • No options are defined.
    @@ -110,11 +97,11 @@ as name.

    Interface

    -     s6 set list [ -E | -e ]
    +     s6 set list [ -E | -e ] [ -s setname ]
     
      -
    • s6 set list lists all the services in the current set, +
    • s6 set list lists all the services in the current set, printing their names on stdout, one per line.
    @@ -127,6 +114,9 @@ default.
-e, --without-essentials
Do not list essential services.
+ +
-s setname, --set=setname
+
List the services in the set named setname rather than current.

status

@@ -134,12 +124,12 @@ default.

Interface

-     s6 set status [ -E | -e ] [ names... ]
+     s6 set status [ -E | -e ] [ -s setname ] [ names... ]
 
  • s6 set status lists the services named names... -in the working set with their current +in the current set with their current prescription, i.e. the state that they should be in at boot time: masked, disabled (listed as usable), enabled (listed as active), or essential @@ -180,6 +170,9 @@ default.
-e, --without-essentials
Do not print essential services.
+ +
-s setname, --set=setname
+
List the services in the set named setname, rather than current.
@@ -198,7 +191,7 @@ currently running database.

Interface

-     s6 set enable|disable|mask|unmask|make-essential [ -f ] [ -n ] [ -I fail|warn|pull ] [ services... ]
+     s6 set enable|disable|mask|unmask|make-essential [ -n ] [ -I | -i ] [ -P | -p ] [ -s setname ] [ services... ]
 
    @@ -224,28 +217,33 @@ make the set inconsistent.

    Options

    -
    -f, --ignore-dependencies
    -
    Only change the services listed in services, don't compute dependencies.
    -n, --dry-run
    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
    -
    What to do when services have dependencies, or reverse dependencies, that are not -listed in services.... what can be fail, warn, -or pull. -
      -
    • fail: abort the operation with an error message.
    • -
    • warn: perform the operation with a warning message. The set might -be inconsistent afterwards, that can be changed by manually changing the dependencies -or by fixing the set (see below).
    • -
    • pull: resolve inconsistencies by pulling the dependencies into the -same prescription as the listed service. For enable, -service dependencies are made active as well. For disable, reverse -dependencies are disabled as well. For mask, reverse dependencies are -masked as well.
    • -
    +
    -I, --no-fail-on-dependencies
    +
    Do not fail if a dependency (to a service that's outside the listed ones) is found. +This is the default. Depending on the -p flag, either a warning message will be +printed and an inconsistent set will be made, or the dependency will be pulled into the change.
    + +
    -i, --fail-on-dependencies
    +
    If a dependency is found that would create an inconsistent set if the change was +applied, print an error message and exit 1.
    + +
    -P, --no-pull-dependencies
    +
    If a dependency is found that would create an inconsistent set if the change was +applied, print a warning message (if verbosity is not 0) listing the services that +also need to change prescriptions; then apply the change anyway. This is the default.
    + +
    -p, --pull-dependencies
    +
    If a dependency is found that would create an inconsistent set, automatically +extend the change to the dependencies as well so the set remain consistent. Print an +informational message (if verbosity is 2 or more) listing the services that are being +pulled into the change, then apply the change.
    + +
    -s setname, --set=setname
    +
    Perform the change on set setname. Default is current

    check

    @@ -253,11 +251,11 @@ masked as well.

    Interface

    -     s6 set check [ -F ] [ -d | -u ] [ -E | -e ]
    +     s6 set check [ -F ] [ -d | -u ] [ -E | -e ] [ -s setname ]
     
      -
    • s6 set check checks the current working set for +
    • s6 set check checks the current set for inconsistencies, printing anything it finds to stdout.
    @@ -290,6 +288,9 @@ default.
Fix the set by enabling or unmasking services. If service A depends on service B and A is unmasked or enabled, change B to be unmasked or enabled as well.
+ +
-s setname, --set=setname
+
Check the set named setname, rather than current.

commit

@@ -297,7 +298,7 @@ change B to be unmasked or enabled as well.

Interface

-     s6 set commit [ -f ] [ -K ] [ -D defaultbundle ] [ -h fdhuser ]
+     s6 set commit [ -f ] [ -K ] [ -D defaultbundle ] [ -h fdhuser ] [ -s setname ]