s6-frontend
Software
skarnet.org
The s6-frontend internal program
s6-frontend is the program that does the real command dispatching behind the s6 command line. It is not meant to be called directly; users should call s6 instead.
Interface
s6-frontend [ global_options... ] command subcommand [ subcommand_options... ] [ args... ]
Detailed operation
What really happens when you call s6 args... is the following:
- s6 gets the name of its configuration file from the S6_FRONTEND_CONF environment variable, or from the compiled-in default if this variable is unset. Normally this default is /etc/s6-frontend.conf.
- This configuration file (let's call it conf) contains variable definitions that set the default for all the parts of the s6 system.
- s6 rewrites itself into
envfile -I conf -- s6-frontend args... - The envfile program reads and parses conf, and then runs s6-frontend with the additional environment variables defined in conf.
- s6-frontend sets its defaults according to these environment variables, then performs the work described in the documents linked from the s6 page.
The separation between s6 and s6-frontend is really just a trick to avoid writing an additional parser for the s6-frontend.conf configuration file. Using envfile to read the configuration was a natural fit because the execline set of tools is used by s6-frontend to build complex command lines.
That is why usage messages given by the various s6 foobar help
commands print Usage: s6 foobar subcommand... but error messages, if
they happen, print s6-frontend: fatal: error condition, because
the program where the error occurred is s6-frontend, not s6.
Note that most error messages will print the name of another command, somewhere in the s6 ecosystem. That is a command invoked by s6-frontend to perform the task required by the user; and if it fails, its own error message will be more informative than whatever wrapping s6-frontend could do. This might be a little confusing at first, but a design decision was made that it was a better trade-off to provide accurate error messages at the expense of a little predictability in the name of the program that prepends the error messages.
In summary:
- s6 is what the user types
- s6-frontend is what interprets the user's command into orders to give to various parts of the s6 ecosystem
- Various programs from the s6 supervision suite or the s6-rc service manager, invoked by s6-frontend, perform the work. When they succeed it is transparent; when they fail they prepend the error message with their name.
