s6-rc: the s6-rc-set-change program
Keywords: s6-rc s6-rc-set-change repo set rx change services

s6-rc
Software
skarnet.org

# The s6-rc-set-change program

s6-rc-set-change modifies a set by changing the rx of some services.

## Interface

         s6-rc-set-change [ -v verbosity ] [ -r repo ] [ -E | -e ] [ -f | -I fail|pull|warn ] [ -n ] set newrx services...

- s6-rc-set-change operates on set set in repository repo.
- It attempts to move all the services listed in services... into rx newrx.
- It exits 0.

## Options

-v verbosity, --verbosity=verbosity
  Be more or less verbose. The default is 1, which means that error messages and warnings will be written to stderr. 0 means that only error messages will be written, and 2 or more adds informational messages.
-r repo, --repository=repo
  Use the repository in repo, which must exist. Default is /var/lib/s6-rc/repository.
-E, --no-force-essential
  If a service needs to be moved to/from the `always` rx, fail and report an error. This is the default. Services marked as always are normally defined in the stores with `flag-essential`, and inconsistencies between essential services should be resolved in the stores.
-e, --force-essential
  Move services to/from the `always` rx if they need to be. This option should only be used temporarily until the store inconsistency is fixed. Be aware that moving a service from always to usable or masked may result in an unbootable set.
-f, --ignore-dependencies
  Change services... to newrx, but do not change any other services, even if the dependency graph would normally mandate it. This may result in an inconsistent set that you cannot commit.

-I action, --if-dependencies-found=action
  Determine what to do if a dependency would make the set inconsistent. For instance, if service `A` depends on service `B`, they are both in the `latent` rx, and you are trying to change `A` to `active` without mentioning `B`, this would not work: in order to be brought up at boot time, `A` would first need `B` to also be brought up at boot time, so `A` can only be `active` if `B` also is. In that situation, what s6-rc-set-change does depends on the value of action:
  - `fail`: print an error message and exit 1.
  - `warn`: print a warning message and proceed. This is the default.
  - `pull`: print a warning message and pull the dependencies of services... into newrx. (Or the reverse dependencies, if you're trying to disable or mask services.
  The warning messages are not printed if verbosity is 0.
-n, --dry-run
  Check whether the command would succeed, print warning or error messages if appropriate, but do not perform the actual modifications.

## Exit codes

0
  Success.
1
  `-I fail` was given and dependencies prevented services... from being changed to newrx.
3
  A service in services... was not found in the reference database.
4
  Invalid or corrupted reference database.
100
  Incorrect usage.
102
  Inconsistent repository.
111
  System call failed.

## Notes

- s6-rc-set-change is the bread and butter of repo operations. It is how users can tailor the set of services they want to be enabled at boot time.
- Once a change has been effected, and the command says that the set is consistent, it can be committed.
- If you are masking or unmasking services, and you see it pulling services that are not dependencies of the service you're unmasking or are not depending on the service you're masking, it is because these services are part of the same pipeline. If you mask a part of a pipeline, the whole pipeline needs to be masked.