aboutsummaryrefslogtreecommitdiffstats
path: root/doc/s6-rc-set-change.html
blob: 8d0b13aba7db996615ebeb49433107aafe1afd17 (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
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />
    <title>s6-rc: the s6-rc-set-change program</title>
    <meta name="Description" content="s6-rc: the s6-rc-set-change program" />
    <meta name="Keywords" content="s6-rc s6-rc-set-change repo set rx change services" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

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

<h1> The s6-rc-set-change program </h1>

<p>
 s6-rc-set-change modifies a <a href="repodefs.html#set">set</a> by changing
the <a href="repodefs.html#rx">rx</a> of some services.
</p>

<h2> Interface </h2>

<pre>
     s6-rc-set-change [ -v <em>verbosity</em> ] [ -r <em>repo</em> ] [ -E | -e ] [ -f | -I fail|pull|warn ] [ -n ] <em>set</em> <em>newrx</em> <em>services...</em>
</pre>

<ul>
 <li> s6-rc-set-change operates on <a href="repodefs.html#set">set</a> <em>set</em> in <a href="repodefs.html#repository">repository</a> <em>repo</em>. </li>
 <li> It attempts to move all the services listed in <em>services...</em> into <a href="repodefs.html#rx">rx</a> <em>newrx</em>. </li>
 <li> It exits 0. </li>
</ul>

<h2> Options </h2>

<dl>
 <dt> -v <em>verbosity</em>, --verbosity=<em>verbosity</em> </dt>
 <dd> Be more or less verbose. The default is <strong>1</strong>, which means
that error messages and warnings will be written to stderr. 0 means that only
error messages will be written, and 2 or more adds informational messages. </dd>

 <dt> -r <em>repo</em>, --repository=<em>repo</em> </dt>
 <dd> Use the repository in <em>repo</em>, which must exist. Default is
<strong>/var/lib/s6-rc/repository</strong>.
 </dd>

 <dt> -E, --no-force-essential </dt>
 <dd> If a service needs to be moved to/from the <tt>always</tt> rx, fail and report
an error. This is the default. Services marked as <em>always</em> are normally defined
in the stores with <tt>flag-essential</tt>, and inconsistencies between essential
services should be resolved in the stores. </dd>

 <dt> -e, --force-essential </dt>
 <dd> Move services to/from the <tt>always</tt> rx if they need to be. This option
should only be used temporarily until the store inconsistency is fixed. Be aware that
moving a service from <em>always</em> to <em>usable</em> or <em>masked</em> may
result in an unbootable set. </dd>

 <dt> -f, --ignore-dependencies </dt>
 <dd> Change <em>services...</em> to <em>newrx</em>, but do not change any other
services, even if the dependency graph would normally mandate it. This may result
in an inconsistent set that you cannot commit. </dd>
</dl>

 <dt> -I <em>action</em>, --if-dependencies-found=<em>action</em> </dt>
 <dd> Determine what to do if a dependency would make the set inconsistent.
For instance, if service <tt>A</tt> depends on service <tt>B</tt>, they are both
in the <tt>latent</tt> rx, and you are trying to change <tt>A</tt> to <tt>active</tt>
without mentioning <tt>B</tt>, this would not work: in order to be brought up at
boot time, <tt>A</tt> would first need <tt>B</tt> to also be brought up at boot time,
so <tt>A</tt> can only be <tt>active</tt> if <tt>B</tt> also is. In that situation,
what s6-rc-set-change does depends on the value of <em>action</em>:
  <ul>
   <li> <tt>fail</tt>: print an error message and exit 1. </li>
   <li> <tt>warn</tt>: print a warning message and proceed. This is the default. </li>
   <li> <tt>pull</tt>: print a warning message and pull the dependencies of
<em>services...</em> into <em>newrx</em>. (Or the reverse dependencies, if
you're trying to disable or mask services. </li>
  </ul>
 The warning messages are not printed if <em>verbosity</em> is 0. </dd>

 <dt> -n, --dry-run </dt>
 <dd> Check whether the command would succeed, print warning or error messages if
appropriate, but do not perform the actual modifications. </dd>

<h2> Exit codes </h2>

<dl>
 <dt> 0 </dt> <dd> Success. </dd>
 <dt> 1 </dt> <dd> <tt>-I fail</tt> was given and dependencies prevented <em>services...</em>
from being changed to <em>newrx</em>. </dd>
 <dt> 3 </dt> <dd> A service in <em>services...</em> was not found in the reference database. </dt>
 <dt> 4 </dt> <dd> Invalid or corrupted reference database. </dd>
 <dt> 100 </dt> <dd> Incorrect usage. </dd>
 <dt> 102 </dt> <dd> Inconsistent repository. </dd>
 <dt> 111 </dt> <dd> System call failed. </dd>
</dl>

<h2> Notes </h2>

<ul>
 <li> s6-rc-set-change is the bread and butter of <em>repo</em> operations. It is how users
can tailor the set of services they want to be enabled at boot time. </li>
 <li> Once a change has been effected, and the command says that the set is consistent,
it can be <a href="s6-rc-set-commit">committed</a>. </li>
 <li> If you are masking or unmasking services, and you see it pulling services that
are not dependencies of the service you're unmasking or are not depending on the service
you're masking, it is because these services are part of the same pipeline. If you mask
a part of a pipeline, the whole pipeline needs to be masked. </li>
</ul>

</body>
</html>