Debian Codegraph @

man/systemd-sysupdate.xml

raw
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="systemd-sysupdate" conditional='ENABLE_SYSUPDATE'
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>systemd-sysupdate</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>systemd-sysupdate</refentrytitle>
16 <manvolnum>8</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>systemd-sysupdate</refname>
21 <refname>systemd-sysupdate.service</refname>
22 <refname>systemd-sysupdate.timer</refname>
23 <refname>systemd-sysupdate-reboot.service</refname>
24 <refname>systemd-sysupdate-reboot.timer</refname>
25 <refpurpose>Automatically Update OS or Other Resources</refpurpose>
26 </refnamediv>
27
28 <refsynopsisdiv>
29 <cmdsynopsis>
30 <command>systemd-sysupdate</command>
31 <arg choice="opt" rep="repeat">OPTIONS</arg>
32 </cmdsynopsis>
33
34 <para><filename>systemd-sysupdate.service</filename></para>
35 </refsynopsisdiv>
36
37 <refsect1>
38 <title>Description</title>
39
40 <para><command>systemd-sysupdate</command> atomically updates the host OS, container images, portable
41 service images or other sources, based on the transfer configuration files described in
42 <citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
43
44 <para>This tool implements file, directory, or partition based update schemes, supporting multiple
45 parallel installed versions of specific resources in an A/B (or even: A/B/C, A/B/C/D/, …) style. A/B
46 updating means that when one version of a resource is currently being used, the next version can be
47 downloaded, unpacked, and prepared in an entirely separate location, independently of the first, and — once
48 complete — be activated, swapping the roles so that it becomes the used one and the previously used one
49 becomes the one that is replaced by the next update, and so on. The resources to update are defined
50 in transfer files, one for each resource to be updated. For example, resources that may be updated with
51 this tool could be: a root file system partition, a matching Verity partition plus one kernel image. The
52 combination of the three would be considered a complete OS update.</para>
53
54 <para>The tool updates partitions, files or directory trees always in whole, and operates with at least
55 two versions of each of these resources: the <emphasis>current</emphasis> version, plus the
56 <emphasis>next</emphasis> version: the one that is being updated to, and which is initially incomplete as
57 the downloaded data is written to it; plus optionally more versions. Once the download of a newer version
58 is complete it becomes the current version, releasing the version previously considered current for
59 deletion/replacement/updating.</para>
60
61 <para>When installing new versions the tool will directly download, decompress, unpack and write the new
62 version into the destination. This is done in a robust fashion so that an incomplete download can be
63 recognized on next invocation, and flushed out before a new attempt is initiated.</para>
64
65 <para>Note that when writing updates to a partition, the partition has to exist already, as
66 <command>systemd-sysupdate</command> will not automatically create new partitions. Use a tool such as
67 <citerefentry><refentrytitle>systemd-repart</refentrytitle><manvolnum>8</manvolnum></citerefentry> to
68 automatically create additional partitions to be used with <command>systemd-sysupdate</command> on
69 boot.</para>
70
71 <para>The tool can both be used on the running OS, to update the OS in "online" state from within itself,
72 and on "offline" disk images, to update them from the outside based on transfer files
73 embedded in the disk images. For the latter, see <option>--image=</option> below. The latter is
74 particularly interesting to update container images or portable service images.</para>
75
76 <para>The <filename>systemd-sysupdate.service</filename> system service will automatically update the
77 host OS based on the installed transfer files. It is triggered in regular intervals via
78 <filename>systemd-sysupdate.timer</filename>. The <filename>systemd-sysupdate-reboot.service</filename>
79 will automatically reboot the system after a new version is installed. It is triggered via
80 <filename>systemd-sysupdate-reboot.timer</filename>. The two services are separate from each other as it
81 is typically advisable to download updates regularly while the system is up, but delay reboots until the
82 appropriate time (i.e. typically at night). The two sets of service/timer units may be enabled
83 separately.</para>
84
85 <para>For details about transfer files and examples see
86 <citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
87 </refsect1>
88
89 <refsect1>
90 <title>Command</title>
91
92 <para>The following commands are understood:</para>
93
94 <variablelist>
95 <varlistentry>
96 <term><option>list</option> <optional><replaceable>VERSION</replaceable></optional></term>
97
98 <listitem><para>If invoked without an argument, enumerates downloadable and installed versions, and
99 shows a summarizing table with the discovered versions and their properties, including whether
100 there's a newer candidate version to update to. If a version argument is specified, shows details
101 about the specific version, including the individual files that need to be transferred to acquire the
102 version.</para>
103
104 <para>If no command is explicitly specified this command is implied.</para>
105
106 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
107 </varlistentry>
108
109 <varlistentry>
110 <term><option>features</option> <optional><replaceable>FEATURE</replaceable></optional></term>
111
112 <listitem><para>If invoked without an argument, enumerates optional features and shows a summarizing
113 table, including which features are enabled or disabled. If a feature argument is specified, shows
114 details about the specific feature, including the transfers that are controlled by the feature.</para>
115
116 <xi:include href="version-info.xml" xpointer="v257"/></listitem>
117 </varlistentry>
118
119 <varlistentry>
120 <term><option>check-new</option></term>
121
122 <listitem><para>Checks if there's a new version available. This internally enumerates downloadable and
123 installed versions and returns exit status 0 if there's a new version to update to, non-zero
124 otherwise. If there is a new version to update to, its version identifier is written to standard
125 output.</para>
126
127 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
128 </varlistentry>
129
130 <varlistentry>
131 <term><option>update</option> <optional>--offline</optional> <optional><replaceable>VERSION</replaceable></optional></term>
132
133 <listitem><para>Installs (updates to) the specified version, or if none is specified to the newest
134 version available. If the version is already installed or no newer version available, no operation is
135 executed.</para>
136
137 <para>If <option>--offline</option> is specified, the update must already have been acquired using
138 <command>acquire</command> and, if so, this pre-acquired version is the one which will be updated
139 to.</para>
140
141 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
142 </varlistentry>
143
144 <varlistentry>
145 <term><option>acquire</option> <optional><replaceable>VERSION</replaceable></optional></term>
146
147 <listitem><para>Acquires (downloads) the specified version, ready to install it. If no version is
148 specified, the newest version available is acquired. If the version is already installed or no newer
149 version is available, no operation is executed.</para>
150
151 <para>If a new version to install/update to is found, old installed versions are deleted until at
152 least one new version can be installed, as configured via <varname>InstanceMax=</varname> in
153 <citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>, or
154 via the available partition slots of the right type. This implicit operation can also be invoked
155 explicitly via the <command>vacuum</command> command described below.</para>
156
157 <xi:include href="version-info.xml" xpointer="v260"/></listitem>
158 </varlistentry>
159
160 <varlistentry>
161 <term><option>vacuum</option></term>
162
163 <listitem><para>Deletes old installed versions until the limits configured via
164 <varname>InstanceMax=</varname> in
165 <citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry> are
166 met again. Normally, it should not be necessary to invoke this command explicitly, since it is
167 implicitly invoked whenever a new update is initiated.</para>
168
169 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
170 </varlistentry>
171
172 <varlistentry>
173 <term><option>pending</option></term>
174
175 <listitem><para>Checks whether a newer version of the OS is installed than the one currently
176 running. Returns zero if so, non-zero otherwise. This compares the newest installed version's
177 identifier with the OS image version as reported by the <varname>IMAGE_VERSION=</varname> field in
178 <filename>/etc/os-release</filename>. If the former is newer than the latter, an update was
179 apparently completed but not activated (i.e. rebooted into) yet.</para>
180
181 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
182 </varlistentry>
183
184 <varlistentry>
185 <term><option>reboot</option></term>
186
187 <listitem><para>Similar to the <option>pending</option> command but immediately reboots in case a
188 newer version of the OS has been installed than the one currently running. This operation can be done
189 implicitly together with the <command>update</command> command, after a completed update via the
190 <option>--reboot</option> switch, see below. This command will execute no operation (and return
191 success) if no update has been installed, and thus the system was not rebooted.</para>
192
193 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
194 </varlistentry>
195
196 <varlistentry>
197 <term><option>components</option></term>
198
199 <listitem><para>Lists components that can be updated. This enumerates the
200 <filename>/etc/sysupdate.*.d/</filename>, <filename>/run/sysupdate.*.d/</filename> and
201 <filename>/usr/lib/sysupdate.*.d/</filename> directories that contain transfer files. This command is
202 useful to list possible parameters for <option>--component=</option> (see below).</para>
203
204 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
205 </varlistentry>
206
207 <xi:include href="standard-options.xml" xpointer="help" />
208 <xi:include href="standard-options.xml" xpointer="version" />
209 </variablelist>
210 </refsect1>
211
212 <refsect1>
213 <title>Options</title>
214
215 <para>The following options are understood:</para>
216
217 <variablelist>
218
219 <varlistentry>
220 <term><option>--component=</option></term>
221 <term><option>-C</option></term>
222
223 <listitem><para>Selects the component to update. Takes a component name as argument. This has the
224 effect of slightly altering the search logic for transfer files. If this switch is not used, the
225 transfer files are loaded from <filename>/etc/sysupdate.d/*.conf</filename>,
226 <filename>/run/sysupdate.d/*.conf</filename> and <filename>/usr/lib/sysupdate.d/*.conf</filename>. If
227 this switch is used, the specified component name is used to alter the directories to look in to be
228 <filename>/etc/sysupdate.<replaceable>component</replaceable>.d/*.conf</filename>,
229 <filename>/run/sysupdate.<replaceable>component</replaceable>.d/*.conf</filename> and
230 <filename>/usr/lib/sysupdate.<replaceable>component</replaceable>.d/*.conf</filename>, each time with
231 the <filename><replaceable>component</replaceable></filename> string replaced with the specified
232 component name.</para>
233
234 <para>Use the <command>components</command> command to list available components to update. This enumerates
235 the directories matching this naming rule.</para>
236
237 <para>Components may be used to define a separate set of transfer files for different components of
238 the OS that shall be updated separately. Do not use this concept for resources that shall always be
239 updated together in a synchronous fashion. Simply define multiple transfer files within the same
240 <filename>sysupdate.d/</filename> directory for these cases.</para>
241
242 <para>This option may not be combined with <option>--definitions=</option>.</para>
243
244 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
245 </varlistentry>
246
247 <varlistentry>
248 <term><option>--definitions=</option></term>
249
250 <listitem><para>A path to a directory. If specified, the transfer <filename>*.conf</filename> files
251 are read from this directory instead of <filename>/usr/lib/sysupdate.d/*.conf</filename>,
252 <filename>/etc/sysupdate.d/*.conf</filename>, and <filename>/run/sysupdate.d/*.conf</filename>.</para>
253
254 <para>This option may not be combined with <option>--component=</option>.</para>
255
256 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
257 </varlistentry>
258
259 <varlistentry>
260 <term><option>--root=</option></term>
261
262 <listitem><para>Takes a path to a directory to use as root file system when searching for
263 <filename>sysupdate.d/*.conf</filename> files.</para>
264
265 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
266 </varlistentry>
267
268 <varlistentry>
269 <term><option>--image=</option></term>
270
271 <listitem><para>Takes a path to a disk image file or device to mount and use in a similar fashion to
272 <option>--root=</option>, see above. If this is used and partition resources are updated this is done
273 inside the specified disk image.</para>
274
275 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
276 </varlistentry>
277
278 <xi:include href="standard-options.xml" xpointer="image-policy-open" />
279
280 <varlistentry>
281 <term><option>--instances-max=</option></term>
282 <term><option>-m</option></term>
283
284 <listitem><para>Takes a decimal integer greater than or equal to 2 while updating or 1 while vacuuming.
285 Controls how many versions to keep at any time. This option may also be configured inside the transfer
286 files, via the <varname>InstancesMax=</varname> setting, see
287 <citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
288 details.</para>
289
290 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
291 </varlistentry>
292
293 <varlistentry>
294 <term><option>--sync=</option></term>
295
296 <listitem><para>Takes a boolean argument, defaults to yes. This may be used to specify whether the
297 newly updated resource versions shall be synchronized to disk when appropriate (i.e. after the
298 download is complete, before it is finalized, and again after finalization). This should not be
299 turned off, except to improve runtime performance in testing environments.</para>
300
301 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
302 </varlistentry>
303
304 <varlistentry>
305 <term><option>--verify=</option></term>
306
307 <listitem><para>Takes a boolean argument, defaults to yes. Controls whether to cryptographically
308 verify downloads. Do not turn this off, except in testing environments.</para>
309
310 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
311 </varlistentry>
312
313 <varlistentry>
314 <term><option>--reboot</option></term>
315
316 <listitem><para>When used in combination with the <command>update</command> commands and a new version is
317 installed, automatically reboots the system immediately afterwards.</para>
318
319 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
320 </varlistentry>
321
322 <varlistentry>
323 <term><option>--offline</option></term>
324
325 <listitem><para>Prevents fetching metadata from the network (i.e. <filename>SHA256SUMS</filename>).
326 This is most useful when used in combination with the <command>list</command> command, to query
327 locally installed versions.</para>
328
329 <para>If used in combination with the <command>update</command> command, it allows updates to be
330 downloaded in advance (using <command>acquire</command>) and installed later.</para>
331
332 <xi:include href="version-info.xml" xpointer="v257"/></listitem>
333 </varlistentry>
334
335 <varlistentry>
336 <term><option>--transfer-source=</option></term>
337
338 <listitem><para>Takes a path as its argument. When specified, all transfer sources configured with
339 <varname>PathRelativeTo=explicit</varname> will be interpreted relative to the specified path.</para>
340
341 <xi:include href="version-info.xml" xpointer="v257"/></listitem>
342 </varlistentry>
343
344 <xi:include href="standard-options.xml" xpointer="no-pager" />
345 <xi:include href="standard-options.xml" xpointer="no-legend" />
346 <xi:include href="standard-options.xml" xpointer="json" />
347 </variablelist>
348 </refsect1>
349
350 <refsect1>
351 <title>Exit status</title>
352
353 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
354 </refsect1>
355
356 <refsect1>
357 <title>See Also</title>
358 <para><simplelist type="inline">
359 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
360 <member><citerefentry><refentrytitle>sysupdate.d</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
361 <member><citerefentry><refentrytitle>systemd-sysupdated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
362 <member><citerefentry><refentrytitle>systemd-repart</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
363 </simplelist></para>
364 </refsect1>
365
366 </refentry>