aboutsummaryrefslogtreecommitdiffstats
path: root/doc/s6_set.html
blob: bd742333350cf73bac32dc1201aa7a69905dbf19 (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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<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 set command</title>
    <meta name="Description" content="s6-frontend: the s6 set command" />
    <meta name="Keywords" content="s6 ecosystem supervision service manager user interface init skarnet.org skarnet software repository repo working set load save s6-rc" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

<p>
<a href="s6.html">The s6 command</a><br />
<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 set</tt> command </h1>

<p>
 <tt>s6 set</tt> groups actions on
<a href="//skarnet.org/software/s6-rc/repodefs.html#set">service sets</a>,
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.
</p>

<p>
 Unlike <tt>s6 live</tt>, which deals with starting and stopping services
that are currently running, <tt>s6 set</tt> is an <em>offline</em> tool,
setting services in a state that remains theoretical until the user
<em>commits</em> it and <em>installs</em> the set, making it live.
</p>

<p>
 <tt>s6 set</tt> commands always operate on a "working set" of services,
which is by default named <tt>current</tt>. It is not the set that is
currently live; it is the set that is currently worked on.
</p>

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

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

<h2 id="subcommands"> Subcommands </h2>

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

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

<h3 id="copy"> copy </h3>

<h4> Interface </h4>

<pre>
     s6 set copy [ -f ] <em>source</em> <em>dest</em> 
</pre>

<ul>
 <li> <tt>s6 set copy</tt> copies the set named <em>source</em> to a new set
named <em>dest</em>. </li>
 <li> There is always at least one set named <tt>current</tt>. This is the set being
operated on by default by every <tt>s6 set</tt> command. </li>
</ul>

<h4> Options </h4>

<dl>
<dt> -f, --force </dt>
<dd> If <em>dest</em> already exists, overwrite it with a copy of <em>source</em>.
By default, the command exits with an error instead of overwriting. </dd>

<h3 id="delete"> delete </h3>

<h4> Interface </h4>

<pre>
     s6 set delete <em>names...</em>
</pre>

<ul>
 <li> <tt>s6 set delete</tt> deletes the saved sets named <em>names...</em> </li>
 <li> The set named <tt>current</tt> cannot be deleted. </li>
 <li> No options are defined. </li>
</ul>

<h3 id="list"> list </h3>

<h4> Interface </h4>

<pre>
     s6 set list [ -E | -e ] [ -s <em>setname</em> ]
</pre>

<ul>
 <li> <tt>s6 set list</tt> lists all the services in the <tt>current</tt> set,
printing their names on stdout, one per line. </li>
</ul>

<h4> Options </h4>

<dl>
<dt> -E, --with-essentials </dt>
<dd> List all the services, including the essential ones. This is the
default. </dd>

<dt> -e, --without-essentials </dt>
<dd> Do not list essential services. </dd>

<dt> <tt>-s <em>setname</em></tt>, <tt>--set=<em>setname</em></tt> </dt>
<dd> List the services in the set named <em>setname</em> rather than <tt>current</tt>. </dd>
</dl>

<h3 id="status"> status </h3>

<h4> Interface </h4>

<pre>
     s6 set status [ -E | -e ] [ -s <em>setname</em> ] [ <em>names...</em> ]
</pre>

<ul>
 <li> <tt>s6 set status</tt> lists the services named <em>names...</em>
in the <tt>current</tt> set with their current
<a href="//skarnet.org/software/s6-rc/repodefs.html#rx">prescription</a>, i.e.
the state that they should be in at boot time: masked, disabled (listed
as <tt>usable</tt>), enabled (listed as <tt>active</tt>), or essential
(listed as <tt>always</tt>).
  <ul>
   <li> <tt>masked</tt>: 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 <em>inconsistent</em>. </li>
   <li> <tt>usable</tt>: 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
<a href="s6_live.html#start"><tt>s6 live start</tt></a> command. </li>
   <li> <tt>active</tt>: the service will be brought up by
default at boot time. It can later be brought down manually via the
<a href="s6_live.html#stop"><tt>s6 live stop</tt></a> command. </li>
   <li> <tt>always</tt>: 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 <tt>s6 set</tt>
commands. </li>
  </ul> </li>
 <li> The service name is normally followed by a slash (<tt>/</tt>)
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. </li>
 <li> If <em>names...</em> is empty, all the services in the set
are printed along with their prescriptions. </li>
</ul>

<h4> Options </h4>

<dl>
<dt> -E, --with-essentials </dt>
<dd> Prints all the listed services, including the essential ones. This is the
default. </dd>

<dt> -e, --without-essentials </dt>
<dd> Do not print essential services. </dd>

<dt> <tt>-s <em>setname</em></tt>, <tt>--set=<em>setname</em></tt> </dt>
<dd> List the services in the set named <em>setname</em>, rather than <tt>current</tt>. </dd>
</dl>

<div id="enable">
<div id="disable">
<div id="mask">
<div id="unmask">
<div id="make-essential">
<h3 id="change"> enable, disable, mask, unmask, make-essential </h3>
</div></div></div></div></div>
<p>
 These subcommands are the bread and butter of the <tt>s6 set</tt> commands. They
allow the user to tailor the boot sequence to their needs without touching the
currently running database.
</p>

<h4> Interface </h4>

<pre>
     s6 set enable|disable|mask|unmask|make-essential [ -n ] [ -I | -i ] [ -P | -p ] [ -s <em>setname</em> ] [ <em>services...</em> ]
</pre>

<ul>
 <li> These subcommands are built with the same model and do the same
thing: they move the services listed in <em>services...</em> from their
current prescriptions to another.
  <ul>
   <li> <tt>mask</tt> hides the services. Masking means that the service will not appear in the live
service database <em>at all</em>, 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. </li>
   <li> <tt>unmask</tt> and <tt>disable</tt> put the services in the <tt>usable</tt> prescription, i.e. unmasked and disabled. </li>
   <li> <tt>enable</tt> puts the services in the <tt>enabled</tt> prescription. </li>
   <li> <tt>make-essential</tt> 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. </li>
  </ul> </li>
 <li> Dependencies across services are computed and the command will print a message if the change would
make the set inconsistent. </li>
</ul>

<h4> Options </h4>

<dl>

<dt> -n, --dry-run </dt>
<dd> Do not perform the change; only show what would be done and check whether the set
would be made inconsistent. </dd>

 <dt> <tt>-I</tt>, <tt>--no-fail-on-dependencies</tt> </dt>
 <dd> Do not fail if a dependency (to a service that's outside the listed ones) is found.
This is the default. Depending on the <tt>-p</tt> flag, either a warning message will be
printed and an inconsistent set will be made, or the dependency will be pulled into the change. </dd>

 <dt> <tt>-i</tt>, <tt>--fail-on-dependencies</tt> </dt>
 <dd> If a dependency is found that would create an inconsistent set if the change was
applied, print an error message and exit 1. </dd>

 <dt> <tt>-P</tt>, <tt>--no-pull-dependencies</tt> </dt>
 <dd> 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. </dd>

 <dt> <tt>-p</tt>, <tt>--pull-dependencies</tt> </dt>
 <dd> 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. </dd>

 <dt> <tt>-s <em>setname</em></tt>, <tt>--set=<em>setname</em></tt> </dt>
 <dd> Perform the change on set <em>setname</em>. Default is <strong>current</strong> </dd>
</dl>

<h3 id="check"> check </h3>

<h4> Interface </h4>

<pre>
     s6 set check [ -F ] [ -d | -u ] [ -E | -e ] [ -s <em>setname</em> ]
</pre>

<ul>
 <li> <tt>s6 set check</tt> checks the <tt>current</tt> set for
inconsistencies, printing anything it finds to stdout. </li>
</ul>

<h4> Options </h4>

<dl>
<dt> -F, --fix </dt>
<dd> Also attempt to fix the inconsistencies. </dd>

<dt> -E, --no-force-essential </dt>
<dd> If fixing the set involves changing a service flagged as essential
to a prescription that is <em>not</em> <tt>always</tt>, or a service <em>not</em>
flagged as essential to the <tt>always</tt> prescription, print an error message
and exit. This is the default. </dd>

<dt> -e, --force-essential </dt>
<dd> If fixing the set involves changing a service flagged as essential
to a prescription that is <em>not</em> <tt>always</tt>, or a service <em>not</em>
flagged as essential to the <tt>always</tt> prescription, perform the change
and continue. This is normally not necessary with a list of stores
providing consistent services. </dd>

<dt> -d, --down </dt>
<dd> Fix the set by disabling or masking services. If service <tt>A</tt>
depends on service <tt>B</tt> and <tt>B</tt> is masked or disabled,
change <tt>A</tt> to be masked or disabled as well. This is the
default. </dd>

<dt> -u, --up </dt>
<dd> Fix the set by enabling or unmasking services. If service <tt>A</tt>
depends on service <tt>B</tt> and <tt>A</tt> is unmasked or enabled,
change <tt>B</tt> to be unmasked or enabled as well. </dd>

<dt> <tt>-s <em>setname</em></tt>, <tt>--set=<em>setname</em></tt> </dt>
<dd> Check the set named <em>setname</em>, rather than <tt>current</tt>. </dd>
</dl>

<h3 id="commit"> commit </h3>

<h4> Interface </h4>

<pre>
     s6 set commit [ -f ] [ -K ] [ -D <em>defaultbundle</em> ] [ -h <em>fdhuser</em> ] [ -s <em>setname</em> ]
</pre>

<ul>
 <li> <tt>s6 set commit</tt>
<a href="//skarnet.org/software/s6-rc/repodefs.html#commit">commits</a>
the current set: it attempts to
<a href="//skarnet.org/software/s6-rc/s6-rc-compile.html">compile</a> a
service database out of the set. </li>
 <li> 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 <a href="#check"><tt>s6 set check -F</tt></a> command. </li>
 <li> Once the set has been committed, in order to actually be used it must
be installed via the <a href="s6_live.html#install"><tt>s6 live install</tt></a>
command. </li>
</ul>

<h4> Options </h4>

<dl>
<dt> -f, --force </dt>
<dd> Compile the database even if no change has been performed since the
last time the set was committed. </dd>

<dt> -K, --keep-old </dt>
<dd> 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. </dd>

<dt> -D <em>defaultbundle</em>, --default-bundle=<em>defaultbundle</em> </dt>
<dd> The name of the bundle that holds all <tt>active</tt> and <tt>always</tt>
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
<tt>default</tt>. </dd>

<dt> -h <em>fdhuser</em>, --fdholder-user=<em>fdhuser</em> </dt>
<dd> Specify the fdholder user for the compiled database built from
the set. This must be a user name defined in the <tt>/etc/passwd</tt>
file or whatever user database the system uses. The default is <tt>root</tt>
and that is fine. </dd>

<dt> <tt>-s <em>setname</em></tt>, <tt>--set=<em>setname</em></tt> </dt>
<dd> Commit the set named <em>setname</em>, rather than <tt>current</tt>. </dd>
</dl>

</body>
</html>