The s6 command
s6-frontend
Software
skarnet.org
The s6 set command
s6 set groups actions on service sets, telling the service manager what services should be enabled or disabled at boot time, and which should be masked, i.e. should not even appear in the list of services available at next boot.
Unlike s6 live, which deals with starting and stopping services that are currently running, s6 set is an offline tool, setting services in a state that remains theoretical until the user commits it and installs the set, making it live.
s6 set commands always operate on a "working set" of services, which is by default named current. It is not the set that is currently live; it is the set that is currently worked on.
Interface
s6 set subcommand [ subcommand_options... ] [ args... ]
Subcommands
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.
copy
Interface
s6 set copy [ -f ] source dest
- 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 dest already exists, overwrite it with a copy of source. By default, the command exits with an error instead of overwriting.
- s6 set delete deletes the saved sets named names...
- The set named current cannot be deleted.
- No options are defined.
- s6 set list lists all the services in the current set, printing their names on stdout, one per line.
- -E, --with-essentials
- List all the services, including the essential ones. This is the default.
- -e, --without-essentials
- Do not list essential services.
- -s setname, --set=setname
- List the services in the set named setname rather than current.
- s6 set status lists the services named names...
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
(listed as always).
- masked: the service will not even appear in the live service database, it will be entirely omitted. If a service depends on a masked service, it should be masked too, otherwise the set is said to be inconsistent.
- usable: the service will be listed in the live service database but will not be brought up by default at boot time. It can later be brought up manually via the s6 live start command.
- active: the service will be brought up by default at boot time. It can later be brought down manually via the s6 live stop command.
- always: the service is considered essential: it will always be brought up at boot time and it cannot be brought down without special options to force it down; it normally stays up until the machine is shut down. Essential services are marked as such in the stores and generally should not be tampered with via s6 set commands.
- The service name is normally followed by a slash (/) then the name of the prescription the service is in. On a terminal with util-linux support every line is pretty-printed into columns instead.
- If names... is empty, all the services in the set are printed along with their prescriptions.
- -E, --with-essentials
- Prints all the listed services, including the essential ones. This is the default.
- -e, --without-essentials
- Do not print essential services.
- -s setname, --set=setname
- List the services in the set named setname, rather than current.
- These subcommands are built with the same model and do the same
thing: they move the services listed in services... from their
current prescriptions to another.
- mask hides the services. Masking means that the service will not appear in the live service database at all, it will not be listed, it will not be usable until it is unmasked in a new working set that is subsequently committed and installed. Masking is useful when the stores provide services that come from random installed packages, the user never wants to run these services, and it's just better not to see them.
- unmask and disable put the services in the usable prescription, i.e. unmasked and disabled.
- enable puts the services in the enabled prescription.
- make-essential enables the services and marks them as essential. This command should normally not be used: essential services are marked as such in the stores and should not be touched. The command exists for troubleshooting purposes.
- Dependencies across services are computed and the command will print a message if the change would make the set inconsistent.
- -n, --dry-run
- Do not perform the change; only show what would be done and check whether the set would be made inconsistent.
- -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
- s6 set check checks the current set for inconsistencies, printing anything it finds to stdout.
- -F, --fix
- Also attempt to fix the inconsistencies.
- -E, --no-force-essential
- If fixing the set involves changing a service flagged as essential to a prescription that is not always, or a service not flagged as essential to the always prescription, print an error message and exit. This is the default.
- -e, --force-essential
- If fixing the set involves changing a service flagged as essential to a prescription that is not always, or a service not flagged as essential to the always prescription, perform the change and continue. This is normally not necessary with a list of stores providing consistent services.
- -d, --down
- Fix the set by disabling or masking services. If service A depends on service B and B is masked or disabled, change A to be masked or disabled as well. This is the default.
- -u, --up
- 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.
- s6 set commit commits the current set: it attempts to compile a service database out of the set.
- This command must be run once all desired modifications have been done to the set and that its consistency has been ensured, for instance by a s6 set check -F command.
- Once the set has been committed, in order to actually be used it must be installed via the s6 live install command.
- -f, --force
- Compile the database even if no change has been performed since the last time the set was committed.
- -K, --keep-old
- If an old compiled database exists for the set, do not delete it and instead print its path to stdout. By default the old database is deleted when the set is successfully committed.
- -D defaultbundle, --default-bundle=defaultbundle
- The name of the bundle that holds all active and always services and that will be started at boot time. There is generally no reason to change the default, which depends on the distribution and is probably called default.
- -s setname, --set=setname
- Commit the set named setname, rather than current.
- s6 set apply is different from other s6 set commands
in that it does several things in succession, and impacts the live state
of the machine. It does the following:
- Commit the working set, just like s6 set commit
- Install the working set, just like s6 live install
- Reset the live state, just like s6 live reset, so it matches the prescriptions of the working set exactly.
- -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.
- -D defaultbundle, --default-bundle=defaultbundle
- The name of the bundle that holds all active and always services, which will be the ones running on the machine when the command ends. The default depends on the distribution and is probably called default.
- -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.
- -s setname, --set=setname
- Apply the set named setname, rather than current.
- -t timeout, --timeout=timeout
- If installing the set and resetting the state 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 will wait until the task is complete.
delete
Interface
s6 set delete names...
list
Interface
s6 set list [ -E | -e ] [ -s setname ]
Options
status
Interface
s6 set status [ -E | -e ] [ -s setname ] [ names... ]
Options
enable, disable, mask, unmask, make-essential
These subcommands are the bread and butter of the s6 set commands. They allow the user to tailor the boot sequence to their needs without touching the currently running database.
Interface
s6 set enable|disable|mask|unmask|make-essential [ -n ] [ -I | -i ] [ -P | -p ] [ -s setname ] [ services... ]
Options
check
Interface
s6 set check [ -F ] [ -d | -u ] [ -E | -e ] [ -s setname ]
Options
commit
Interface
s6 set commit [ -f ] [ -K ] [ -D defaultbundle ] [ -s setname ]
Options
apply
Interface
s6 set apply [ -b ] [ -D defaultbundle ] [ -s setname ] [ -t timeout ]
