aboutsummaryrefslogtreecommitdiffstats
path: root/doc/s6.html
blob: a5454c3cb98e48ab291c236aa4d26faae851ccfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="color-scheme" content="dark light" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />
    <title>s6-frontend: the s6 program</title>
    <meta name="Description" content="s6-frontend: the s6 program" />
    <meta name="Keywords" content="s6 ecosystem supervision service manager user interface init skarnet.org skarnet software" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

<p>
<a href="index.html">s6-frontend</a><br />
<a href="//skarnet.org/software/">Software</a><br />
<a href="//skarnet.org/">skarnet.org</a>
</p>

<h1> The <tt>s6</tt> program </h1>

<p>
 <tt>s6</tt> is a generic command-line utility that can be used to
interact with a system managed by the
<a href="//skarnet.org/software/s6/">s6 process supervision system</a>, the
<a href="//skarnet.org/software/s6-rc/">s6-rc service manager</a>, and optionally the
<a href="//skarnet.org/software/s6-linux-init/">s6-linux-init boot program</a>.
</p>

<h2 id="interface"> Interface </h2>

<pre>
     s6 [ <em>global_options...</em> ] <em>command</em> <em>subcommand</em> [ <em>subcommand_options...</em> ] [ <em>args...</em> ]
</pre>

<ul>
 <li> s6 reads its configuration file. </li>
 <li> It reads from the command line, in this order: global options,
a command, a subcommand, potentially subcommand options, and potentially
arguments to the command and subcommand. </li>
 <li> It performs various operations, typically invoking binaries from
various parts of the s6 ecosystem, depending on the given command and
subcommand. </li>
</ul>

<h2 id="exitcodes"> Exit codes </h2>

<p>
 s6 always exits 0 on success, 100 on bad usage, and 111 on a system call
failure.
</p>

<p>
 It is difficult to exhaustively list all of the possible exit codes since it
can exec into a wide variety of commands belonging to different parts of the s6
family of programs.  However, in case of an error, the name of the
subprogram where the error occurred is always printed on stderr; you can then
consult the documentation for said subprogram, which will have the explanation
for all its exit codes. For instance, if an invocation of <tt>s6</tt> prints
a message such as <code>s6-rc: fatal: unable to start service foobar</code>,
it means that s6 invoked the <a href="//skarnet.org/software/s6-rc/s6-rc.html">s6-rc</a>
command, and on the linked documentation page you can find the interpretation
of its various exit codes.
</p>

<h2 id="env"> Environment variables </h2>

<ul>
 <li> s6 reads the <code>S6_CONF</code> environment variable
containing the absolute path to the
<a href="s6.conf.html">configuration file</a> for the s6 command. </li>
 <li> If this variable is unset, the default is <tt>/etc/s6.conf</tt>,
possibly overridden by the <tt>--conffile</tt> build-time configure option to
s6-frontend. </li>
</ul>

<h2 id="options"> Global options </h2>

<p>
 <em>global_options...</em> is a list of options that modify s6's behaviour
and policies. They should generally not be used; instead, the behaviour should
be set in the <a href="s6.conf.html">configuration file</a>.
Nevertheless, if you need to override the configuration file settings for some
reason, here you go.
</p>

<dl>
 <dt> <tt>-h</tt>, <tt>--help</tt> </dt>
 <dd> Run the <a href="#help"><tt>s6 help</tt></a> command.
Any given command or subcommand is ignored. </dd>

 <dt> <tt>-s <em>scandir</em></tt>, <tt>--scandir=<em>scandir</em></tt> </dt>
 <dd> Use <em>scandir</em> as scan directory (i.e. the directory where
<a href="//skarnet.org/software/s6/s6-svscan.html">s6-svscan</a> runs
and supervises service directories). </dd>

 <dt> <tt>-l <em>livedir</em></tt>, <tt>--livedir=<em>livedir</em></tt> </dt>
 <dd> Use <em>livedir</em> as live directory (i.e. the directory where
<a href="//skarnet.org/software/s6-rc/s6-rc.html">s6-rc</a> keeps tabs
on the machine state and stores its runtime information). </dd>

 <dt> <tt>-r <em>repodir</em></tt>, <tt>--repodir=<em>repodir</em></tt> </dt>
 <dd> Use <em>repodir</em> as s6-rc repository (i.e. the directory where
the <a href="//skarnet.org/software/s6-rc/repodefs.html">repo</a> commands
of the <a href="//skarnet.org/software/s6-rc/">s6-rc</a> package store
and manipulate their service sets). </dd>

 <dt> <tt>-c <em>bootdb</em></tt>, <tt>--bootdb=<em>bootdb</em></tt> </dt>
 <dd> Use <em>bootdb</em> as the name of the compiled service database
used by s6-rc at boot time (i.e. the directory where
<a href="//skarnet.org/software/s6-rc/s6-rc.html">s6-rc</a> reads
information on how to start all the wanted services). </dd>

 <dt> <tt>--stmpdir=<em>stmpdir</em></tt> </dt>
 <dd> Use <em>stmpdir</em> to store runtime s6-frontend data and
temporary files. </dd>

 <dt> <tt>--storelist=<em>storelist</em></tt> </dt>
 <dd> Use <em>storelist</em> as list of
<a href="//skarnet.org/software/s6-rc/repodefs.html#store">stores</a>. </dd>

 <dt> <tt>-v <em>verbosity</em></tt>, <tt>--verbosity=<em>verbosity</em></tt> </dt>
 <dd> Use <em>verbosity</em> as numerical verbosity value. </dd>

 <dt> <tt>--color=yes|no|auto</tt> </dt>
 <dd> Use fancy output (which may or may not involve color): always if
<tt>yes</tt>, never if <tt>no</tt>, and only when stdout is a terminal
if <tt>auto</tt>. Not all commands and subcommands will use this
setting. Also, for pretty-printing of columns, it is recommended to
have built s6-frontend with util-linux support. </dd>

 <dt> <tt>-u</tt>, <tt>--user</tt> </dt>
 <dd> Override the variables defined in the configuration file with values
built from XDG environment variables. This option only works if the XDG
environment variables are present in the environment. This option is
useful to address user services. You can see what values are used by
running <tt>s6 -u version export</tt>. </dd>
</dl>


<h2 id="commands"> Commands </h2>

<h3 id="help"> help </h3>

<p>
 <tt>s6 help</tt> prints a short help message summarizing the options
and usage of the s6 command. It is not as detailed as this page.
</p>

<p>
 No subcommands are defined.
</p>

<h3 id="version"> version </h3>

<p>
 <tt>s6 version</tt> prints information about the current version of
s6-frontend and its configuration.
</p>

<p>
 The details are available <a href="s6_version.html">here</a>.
</p>

<h3 id="process"> process </h3>

<p>
 <tt>s6 process</tt> sends commands to long-running processes supervised by the
<a href="//skarnet.org/software/s6/">s6 supervision suite</a>. The details are
available <a href="s6_process.html">here</a>.
</p>

<p>
 <a href="s6_process.html"><tt>s6 process</tt></a> is typically used when a daemon
needs to be restarted or otherwise addressed without involvement from the service
manager, i.e. without having to start or stop dependencies.
</p>

<h3 id="live"> live </h3>

<p>
 <tt>s6 live</tt> controls the live state of the machine, starting and stopping
services, installing a new set of services, etc. It is mostly an interface
around the 
<a href="//skarnet.org/software/s6-rc/">s6-rc service manager</a>. The details are
available <a href="s6_live.html">here</a>.
</p>

<h3 id="repository"> repository </h3>

<p>
 <tt>s6 repository</tt> groups administrative tasks related to the repository
of service sets, typically synchronization with the service stores when the
package manager updates service definitions. It is not often directly used by
sysadmins, but is an essential part of distribution scripts, when they create
the initial layout, run their package manager, etc.
</p>

<p>
The details are available <a href="s6_repository.html">here</a>.
</p>

<h3 id="set"> set </h3>

<p>
 <tt>s6 set</tt> is the interface to the creation and manipulation of service sets by
the user. It is how they define what service will be enabled or disabled at boot
time. This manipulation occurs <em>offline</em>: service sets being worked on are distinct from
the live state of the machine, accessible via <a href="#s6_live"><tt>s6 live</tt></a> commands.

<p>
The details are available <a href="s6_set.html">here</a>.
</p>

<h3 id="system"> system </h3>

<p>
 <tt>s6 system</tt> provides commands to run at boot and, on systems fully managed by s6,
to shut the system down.
The details are available <a href="s6_system.html">here</a>.
</p>

<h2 id="notes"> Notes </h2>

<ul>
 <li> <tt>s6</tt> does not perform real operations itself. Instead, after
finding the path to its <a href="s6.conf.html">configuration file</a>
<em>conf</em>, it rewrites itself into <code>envfile -I <em>conf</em> -- s6-frontend
<em>global_options...</em> <em>command</em> <em>subcommand</em> <em>subcommand_options...</em> <em>args...</em></code>
  <ul>
   <li> <a href="//skarnet.org/software/execline/envfile.html">envfile</a> reads and parses <em>conf</em> </li>
   <li> <a href="s6-frontend.html">s6-frontend</a> is the binary that does the real work of
parsing options, command, subcommand, etc. and dispatching orders. </li>
  </ul>
</ul>

</body>
</html>