summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-tumbleweed/man8/systemd-sysupdate.8
blob: 99d876fa77835a51bb1c1a67349bbf84ae5d07b4 (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
'\" t
.TH "SYSTEMD\-SYSUPDATE" "8" "" "systemd 255" "systemd-sysupdate"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd-sysupdate, systemd-sysupdate.service, systemd-sysupdate.timer, systemd-sysupdate-reboot.service, systemd-sysupdate-reboot.timer \- Automatically Update OS or Other Resources
.SH "SYNOPSIS"
.HP \w'\fBsystemd\-sysupdate\fR\ 'u
\fBsystemd\-sysupdate\fR [OPTIONS...]
.PP
systemd\-sysupdate\&.service
.SH "DESCRIPTION"
.PP
\fBsystemd\-sysupdate\fR
atomically updates the host OS, container images, portable service images or other sources, based on the transfer configuration files described in
\fBsysupdate.d\fR(5)\&.
.PP
This tool implements file, directory, or partition based update schemes, supporting multiple parallel installed versions of specific resources in an A/B (or even: A/B/C, A/B/C/D/, \&...) style\&. A/B updating means that when one version of a resource is currently being used, the next version can be downloaded, unpacked, and prepared in an entirely separate location, independently of the first, and \(em once complete \(em be activated, swapping the roles so that it becomes the used one and the previously used one becomes the one that is replaced by the next update, and so on\&. The resources to update are defined in transfer files, one for each resource to be updated\&. For example, resources that may be updated with this tool could be: a root file system partition, a matching Verity partition plus one kernel image\&. The combination of the three would be considered a complete OS update\&.
.PP
The tool updates partitions, files or directory trees always in whole, and operates with at least two versions of each of these resources: the
\fIcurrent\fR
version, plus the
\fInext\fR
version: the one that is being updated to, and which is initially incomplete as the downloaded data is written to it; plus optionally more versions\&. Once the download of a newer version is complete it becomes the current version, releasing the version previously considered current for deletion/replacement/updating\&.
.PP
When installing new versions the tool will directly download, decompress, unpack and write the new version into the destination\&. This is done in a robust fashion so that an incomplete download can be recognized on next invocation, and flushed out before a new attempt is initiated\&.
.PP
Note that when writing updates to a partition, the partition has to exist already, as
\fBsystemd\-sysupdate\fR
will not automatically create new partitions\&. Use a tool such as
\fBsystemd-repart\fR(8)
to automatically create additional partitions to be used with
\fBsystemd\-sysupdate\fR
on boot\&.
.PP
The tool can both be used on the running OS, to update the OS in "online" state from within itself, and on "offline" disk images, to update them from the outside based on transfer files embedded in the disk images\&. For the latter, see
\fB\-\-image=\fR
below\&. The latter is particularly interesting to update container images or portable service images\&.
.PP
The
systemd\-sysupdate\&.service
system service will automatically update the host OS based on the installed transfer files\&. It is triggered in regular intervals via
systemd\-sysupdate\&.timer\&. The
systemd\-sysupdate\-reboot\&.service
will automatically reboot the system after a new version is installed\&. It is triggered via
systemd\-sysupdate\-reboot\&.timer\&. The two services are separate from each other as it is typically advisable to download updates regularly while the system is up, but delay reboots until the appropriate time (i\&.e\&. typically at night)\&. The two sets of service/timer units may be enabled separately\&.
.PP
For details about transfer files and examples see
\fBsysupdate.d\fR(5)\&.
.SH "COMMAND"
.PP
The following commands are understood:
.PP
\fBlist\fR [\fIVERSION\fR]
.RS 4
If invoked without an argument, enumerates downloadable and installed versions, and shows a summarizing table with the discovered versions and their properties, including whether there\*(Aqs a newer candidate version to update to\&. If a version argument is specified, shows details about the specific version, including the individual files that need to be transferred to acquire the version\&.
.sp
If no command is explicitly specified this command is implied\&.
.sp
Added in version 251\&.
.RE
.PP
\fBcheck\-new\fR
.RS 4
Checks if there\*(Aqs a new version available\&. This internally enumerates downloadable and installed versions and returns exit status 0 if there\*(Aqs a new version to update to, non\-zero otherwise\&. If there is a new version to update to, its version identifier is written to standard output\&.
.sp
Added in version 251\&.
.RE
.PP
\fBupdate\fR [\fIVERSION\fR]
.RS 4
Installs (updates to) the specified version, or if none is specified to the newest version available\&. If the version is already installed or no newer version available, no operation is executed\&.
.sp
If a new version to install/update to is found, old installed versions are deleted until at least one new version can be installed, as configured via
\fIInstanceMax=\fR
in
\fBsysupdate.d\fR(5), or via the available partition slots of the right type\&. This implicit operation can also be invoked explicitly via the
\fBvacuum\fR
command described below\&.
.sp
Added in version 251\&.
.RE
.PP
\fBvacuum\fR
.RS 4
Deletes old installed versions until the limits configured via
\fIInstanceMax=\fR
in
\fBsysupdate.d\fR(5)
are met again\&. Normally, it should not be necessary to invoke this command explicitly, since it is implicitly invoked whenever a new update is initiated\&.
.sp
Added in version 251\&.
.RE
.PP
\fBpending\fR
.RS 4
Checks whether a newer version of the OS is installed than the one currently running\&. Returns zero if so, non\-zero otherwise\&. This compares the newest installed version\*(Aqs identifier with the OS image version as reported by the
\fIIMAGE_VERSION=\fR
field in
/etc/os\-release\&. If the former is newer than the latter, an update was apparently completed but not activated (i\&.e\&. rebooted into) yet\&.
.sp
Added in version 251\&.
.RE
.PP
\fBreboot\fR
.RS 4
Similar to the
\fBpending\fR
command but immediately reboots in case a newer version of the OS has been installed than the one currently running\&. This operation can be done implicitly together with the
\fBupdate\fR
command, after a completed update via the
\fB\-\-reboot\fR
switch, see below\&. This command will execute no operation (and return success) if no update has been installed, and thus the system was not rebooted\&.
.sp
Added in version 251\&.
.RE
.PP
\fBcomponents\fR
.RS 4
Lists components that can be updated\&. This enumerates the
/etc/sysupdate\&.*\&.d/,
/run/sysupdate\&.*\&.d/
and
/usr/lib/sysupdate\&.*\&.d/
directories that contain transfer files\&. This command is useful to list possible parameters for
\fB\-\-component=\fR
(see below)\&.
.sp
Added in version 251\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a short help text and exit\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print a short version string and exit\&.
.RE
.SH "OPTIONS"
.PP
The following options are understood:
.PP
\fB\-\-component=\fR, \fB\-C\fR
.RS 4
Selects the component to update\&. Takes a component name as argument\&. This has the effect of slightly altering the search logic for transfer files\&. If this switch is not used, the transfer files are loaded from
/etc/sysupdate\&.d/*\&.conf,
/run/sysupdate\&.d/*\&.conf
and
/usr/lib/sysupdate\&.d/*\&.conf\&. If this switch is used, the specified component name is used to alter the directories to look in to be
/etc/sysupdate\&.\fIcomponent\fR\&.d/*\&.conf,
/run/sysupdate\&.\fIcomponent\fR\&.d/*\&.conf
and
/usr/lib/sysupdate\&.\fIcomponent\fR\&.d/*\&.conf, each time with the
\fIcomponent\fR
string replaced with the specified component name\&.
.sp
Use the
\fBcomponents\fR
command to list available components to update\&. This enumerates the directories matching this naming rule\&.
.sp
Components may be used to define a separate set of transfer files for different components of the OS that shall be updated separately\&. Do not use this concept for resources that shall always be updated together in a synchronous fashion\&. Simply define multiple transfer files within the same
sysupdate\&.d/
directory for these cases\&.
.sp
This option may not be combined with
\fB\-\-definitions=\fR\&.
.sp
Added in version 251\&.
.RE
.PP
\fB\-\-definitions=\fR
.RS 4
A path to a directory\&. If specified, the transfer
*\&.conf
files are read from this directory instead of
/usr/lib/sysupdate\&.d/*\&.conf,
/etc/sysupdate\&.d/*\&.conf, and
/run/sysupdate\&.d/*\&.conf\&.
.sp
This option may not be combined with
\fB\-\-component=\fR\&.
.sp
Added in version 251\&.
.RE
.PP
\fB\-\-root=\fR
.RS 4
Takes a path to a directory to use as root file system when searching for
sysupdate\&.d/*\&.conf
files\&.
.sp
Added in version 251\&.
.RE
.PP
\fB\-\-image=\fR
.RS 4
Takes a path to a disk image file or device to mount and use in a similar fashion to
\fB\-\-root=\fR, see above\&. If this is used and partition resources are updated this is done inside the specified disk image\&.
.sp
Added in version 251\&.
.RE
.PP
\fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR
.RS 4
Takes an image policy string as argument, as per
\fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via
\fB\-\-image=\fR, see above\&. If not specified defaults to the
"*"
policy, i\&.e\&. all recognized file systems in the image are used\&.
.RE
.PP
\fB\-\-instances\-max=\fR, \fB\-m\fR
.RS 4
Takes a decimal integer greater than or equal to 2\&. Controls how many versions to keep at any time\&. This option may also be configured inside the transfer files, via the
\fIInstancesMax=\fR
setting, see
\fBsysupdate.d\fR(5)
for details\&.
.sp
Added in version 251\&.
.RE
.PP
\fB\-\-sync=\fR
.RS 4
Takes a boolean argument, defaults to yes\&. This may be used to specify whether the newly updated resource versions shall be synchronized to disk when appropriate (i\&.e\&. after the download is complete, before it is finalized, and again after finalization)\&. This should not be turned off, except to improve runtime performance in testing environments\&.
.sp
Added in version 251\&.
.RE
.PP
\fB\-\-verify=\fR
.RS 4
Takes a boolean argument, defaults to yes\&. Controls whether to cryptographically verify downloads\&. Do not turn this off, except in testing environments\&.
.sp
Added in version 251\&.
.RE
.PP
\fB\-\-reboot\fR
.RS 4
When used in combination with the
\fBupdate\fR
command and a new version is installed, automatically reboots the system immediately afterwards\&.
.sp
Added in version 251\&.
.RE
.PP
\fB\-\-no\-pager\fR
.RS 4
Do not pipe output into a pager\&.
.RE
.PP
\fB\-\-no\-legend\fR
.RS 4
Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
.RE
.PP
\fB\-\-json=\fR\fIMODE\fR
.RS 4
Shows output formatted as JSON\&. Expects one of
"short"
(for the shortest possible output without any redundant whitespace or line breaks),
"pretty"
(for a pretty version of the same, with indentation and line breaks) or
"off"
(to turn off JSON output, the default)\&.
.RE
.SH "EXIT STATUS"
.PP
On success, 0 is returned, a non\-zero failure code otherwise\&.
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBsysupdate.d\fR(5),
\fBsystemd-repart\fR(8)