The s6 command
s6-frontend
Software
skarnet.org
The s6 system command
s6 system groups actions related to booting or shutting down
the system.
Interface
s6 system subcommand
- No subcommand takes any options.
Subcommands
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
Interface
s6 system boot
- s6 system boot initializes the live directory for s6-rc
then starts all the services defined in the default bundle. In other
words, it brings the system from a state where nothing is running to
a state where everything the user wants is running.
- This is the command that should be called as soon as the init
program hands off duties.
- On a system making use of
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 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
the shutdown to be clean, the command s6 live stop-everything -E
should be run before the init system performs a hard shutdown. For
instance, if the system uses /etc/inittab, then the
following line should appear in /etc/inittab:
::shutdown:/usr/bin/s6 live stop-everything -E
reboot
Interface
s6 system reboot
- s6 system reboot reboots the machine.
- This only works if the machine makes use of
s6-linux-init and
s6-frontend has been configured to support it.
poweroff
Interface
s6 system poweroff
- s6 system poweroff halts the system and turns the
power off.
- This only works if the machine makes use of
s6-linux-init and
s6-frontend has been configured to support it.
halt
Interface
s6 system halt
- s6 system halt halts the system without turning
the power off.
- This only works if the machine makes use of
s6-linux-init and
s6-frontend has been configured to support it.