Debian Codegraph @

upstream/fedora-44/man5/org.freedesktop.sysupdate1.5

raw
1 '\" t
2 .TH "ORG\&.FREEDESKTOP\&.SYSUPDATE1" "5" "" "systemd 259.5" "org.freedesktop.sysupdate1"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 org.freedesktop.sysupdate1 \- The D\-Bus interface of systemd\-sysupdated
24 .SH "INTRODUCTION"
25 .PP
26 \fBsystemd-sysupdated.service\fR(8)
27 is a system service that allows unprivileged clients to update the system\&. This page describes the D\-Bus interface\&.
28 .PP
29 \fIWARNING!\fR
30 This API is currently
31 \fIunstable\fR
32 and is thus subject to breaking changes between versions of systemd\&.
33 .SH "THE MANAGER OBJECT"
34 .PP
35 The service exposes the following interfaces on the Manager object on the bus:
36 .sp
37 .if n \{\
38 .RS 4
39 .\}
40 .nf
41 node /org/freedesktop/sysupdate1 {
42 interface org\&.freedesktop\&.sysupdate1\&.Manager {
43 methods:
44 ListTargets(out a(sso) targets);
45 ListJobs(out a(tsuo) jobs);
46 ListAppStream(out as urls);
47 signals:
48 JobRemoved(t id,
49 o path,
50 i status);
51 };
52 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
53 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
54 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
55 };
56 .fi
57 .if n \{\
58 .RE
59 .\}
60
61
62
63
64
65 .SS "Methods"
66 .PP
67 \fBListTargets()\fR
68 returns a list all known update targets\&. It returns an array of structures which consist of a string indicating the target\*(Aqs class (see Target\*(Aqs
69 \fIClass\fR
70 property below for an explanation of the possible values), a string with the name of the target, and the target object path\&.
71 .PP
72 \fBListJobs()\fR
73 returns a list all ongoing jobs\&. It returns an array of structures which consist of a numeric job ID, a string indicating the job type (see Job\*(Aqs
74 \fIType\fR
75 property below for an explanation of the possible values), the job\*(Aqs progress, and the job\*(Aqs object path\&.
76 .PP
77 \fBListAppStream()\fR
78 returns an array of all the appstream catalog URLs that this service knows about\&. See Target\*(Aqs
79 \fIGetAppStream()\fR
80 method below for more details\&.
81 .SS "Signals"
82 .PP
83 The
84 \fBJobRemoved()\fR
85 signal is sent each time a job finishes, is canceled or fails\&. It also carries the job ID and object path, followed by a numeric status code\&. If the status is zero, the job has succeed\&. A positive status should be treated as an exit code (i\&.e\&.
86 "EXIT_FAILURE"), and a negative status should be treated as a negative errno\-style error code (i\&.e\&.
87 "\-EINVAL")\&.
88 .SH "THE TARGET OBJECT"
89 .PP
90 A target is a component of the system (i\&.e\&. the host itself, a sysext, a confext, etc\&.) that can be updated by
91 \fBsystemd-sysupdate\fR(8)\&.
92 .PP
93 The service exposes the following interfaces on Target objects on the bus:
94 .sp
95 .if n \{\
96 .RS 4
97 .\}
98 .nf
99 node /org/freedesktop/sysupdate1/target/host {
100 interface org\&.freedesktop\&.sysupdate1\&.Target {
101 methods:
102 List(in t flags,
103 out as versions);
104 Describe(in s version,
105 in t flags,
106 out s json);
107 CheckNew(out s new_version);
108 Update(in s new_version,
109 in t flags,
110 out s new_version,
111 out t job_id,
112 out o job_path);
113 Vacuum(out u instances,
114 out u disabled_transfers);
115 GetAppStream(out as appstream);
116 GetVersion(out s version);
117 ListFeatures(in t flags,
118 out as features);
119 DescribeFeature(in s feature,
120 in t flags,
121 out s json);
122 SetFeatureEnabled(in s feature,
123 in i enabled,
124 in t flags);
125 properties:
126 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
127 readonly s Class = \*(Aq\&.\&.\&.\*(Aq;
128 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
129 readonly s Name = \*(Aq\&.\&.\&.\*(Aq;
130 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
131 readonly s Path = \*(Aq\&.\&.\&.\*(Aq;
132 };
133 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
134 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
135 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
136 };
137 .fi
138 .if n \{\
139 .RE
140 .\}
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155 .SS "Methods"
156 .PP
157 \fBList()\fR
158 returns a list of versions available for this target\&. Additional options may be passed through the
159 \fIflags\fR
160 argument\&. Valid flags are defined as follows:
161 .sp
162 .if n \{\
163 .RS 4
164 .\}
165 .nf
166 #define SD_SYSUPDATE_OFFLINE (UINT64_C(1) << 0)
167 .fi
168 .if n \{\
169 .RE
170 .\}
171 .PP
172 When
173 \fBSD_SYSUPDATE_OFFLINE\fR
174 is set, this method returns only the versions installed locally\&. Otherwise, this method pulls metadata from the network and returns all versions available for this target\&. Use
175 \fBDescribe()\fR
176 to query more information about each version returned by this method\&.
177 .PP
178 \fBDescribe()\fR
179 returns all known information about a given version as a JSON object\&. The
180 \fIversion\fR
181 argument is used to pass the version to be described\&. Additional options may be passed through the
182 \fIflags\fR
183 argument\&. This method supports the same flags as
184 \fBList()\fR\&. The returned JSON object contains several known keys\&. More keys may be added in the future\&. The currently known keys are as follows:
185 .PP
186 "version"
187 .RS 4
188 A string containing the version number\&.
189 .RE
190 .PP
191 "newest"
192 .RS 4
193 A boolean indicating whether this version is the latest available for the target\&.
194 .RE
195 .PP
196 "available"
197 .RS 4
198 A boolean indicating whether this version is available for download\&.
199 .RE
200 .PP
201 "installed"
202 .RS 4
203 A boolean indicating whether this version is installed locally\&.
204 .RE
205 .PP
206 "obsolete"
207 .RS 4
208 A boolean indicating whether this version is considered obsolete by the service, and is therefore disallowed from being installed\&.
209 .RE
210 .PP
211 "protected"
212 .RS 4
213 A boolean indicating whether this version is exempt from deletion by a
214 \fBVacuum()\fR
215 operation\&.
216 .RE
217 .PP
218 "incomplete"
219 .RS 4
220 A boolean indicating whether this version is incomplete, which means that it is missing some file\&. Note that only installed incomplete versions will be offered by the service; versions that are incomplete on the server\-side are completely ignored\&. Incomplete versions can be repaired in\-place by calling
221 \fBUpdate()\fR
222 on that version\&.
223 .RE
224 .PP
225 "changelogUrls"
226 .RS 4
227 A list of strings that contain user\-presentable URLs to change logs associated with this version\&.
228 .RE
229 .PP
230 \fBCheckNew()\fR
231 checks if a newer version is available for this target\&. This method pulls metadata from the network\&. If a newer version is found, this method returns the version number\&. If no newer version is found, this method returns an empty string\&. Use
232 \fBDescribe()\fR
233 to query more information about the version returned by this method\&.
234 .PP
235 \fBUpdate()\fR
236 installs an update for this target\&. If a
237 \fInew_version\fR
238 is specified, that is the version that gets installed\&. Otherwise, the latest version is installed\&. The
239 \fIflags\fR
240 argument is added for future extensibility\&. No flags are currently defined, and the argument is required to be set to
241 "0"\&. Unlike all the other methods in this interface,
242 \fBUpdate()\fR
243 does not wait for its job to complete\&. Instead, it returns the job\*(Aqs numeric ID and object path as soon as the job begins, so that the caller can listen for progress updates or cancel the operation\&. This method also returns the version the target will be updated to, for cases where no version was specified by the caller\&. This method pulls both metadata and payload data from the network\&. Listen for the Manager\*(Aqs
244 \fBJobRemoved()\fR
245 signal to detect when the job is complete\&.
246 .PP
247 \fBVacuum()\fR
248 deletes old installed versions of this target to free up space\&. It returns the number of instances that have been deleted\&.
249 .PP
250 \fBGetAppStream()\fR
251 returns a list of HTTP/HTTPS URLs to this target\*(Aqs
252 \m[blue]\fBappstream catalog\fR\m[]\&\s-2\u[1]\d\s+2
253 XML files\&. If this target has no appstream catalogs, the method will return an empty list\&. These catalog files can be used by software centers (such as GNOME Software or KDE Discover) to present rich metadata about the target, including a display name, changelog, icon, and more\&. The returned catalogs will include
254 \m[blue]\fBspecial metadata\fR\m[]\&\s-2\u[2]\d\s+2
255 to allow the software center to correctly associate the catalogs with this target\&.
256 .PP
257 \fBGetVersion()\fR
258 returns the current version of this target, if any\&. The current version is the newest version that is installed\&. Note that this is not necessarily the same thing as the booted or currently\-in\-use version of the target\&. For example, on the host system the booted version is the current version most of the time, but if an update is installed and pending a reboot it will become the current version instead\&. You can query the booted version of the host system via
259 \fIIMAGE_VERSION\fR
260 in
261 /etc/os\-release\&. If the target has no current version, the function will return an empty string\&.
262 .PP
263 \fBListFeatures()\fR
264 returns a list of this target\*(Aqs optional features, by ID\&. The
265 \fIflags\fR
266 argument is added for future extensibility, and must be set to 0\&. If the target has no optional features, the method returns an empty array\&.
267 .PP
268 \fBDescribeFeature()\fR
269 returns all known information about a given optional feature\&. The
270 \fIfeature\fR
271 argument is used to pass the ID of the feature to be described\&. The
272 \fIflags\fR
273 argument is added for future extensibility, and must be set to 0\&. The returned JSON object contains several known keys\&. More keys may be added in the future\&. The currently known keys are as follows:
274 .PP
275 "name"
276 .RS 4
277 A string containing the feature\*(Aqs name\&.
278 .RE
279 .PP
280 "description"
281 .RS 4
282 An optional string that contains a user\-presentable description that identifies this feature
283 .RE
284 .PP
285 "enabled"
286 .RS 4
287 A boolean indicating whether this feature is enabled\&.
288 .RE
289 .PP
290 "documentationUrl"
291 .RS 4
292 An optional string that contains a user\-presentable HTTP/HTTPS URL to documentation about this feature\&.
293 .RE
294 .PP
295 "appstreamUrl"
296 .RS 4
297 An optional string that contains an HTTP/HTTPS URL to an
298 \m[blue]\fBappstream catalog\fR\m[]\&\s-2\u[1]\d\s+2
299 XML file containing metadata about this feature\&.
300 .RE
301 .PP
302 "transfers"
303 .RS 4
304 An optional array of strings that list which transfer definitions belong to this feature\&.
305 .RE
306 .PP
307 \fBSetFeatureEnabled()\fR
308 writes an appropriate drop\-in file to enable or disable the specified optional feature\&. If
309 \fIenable\fR
310 is zero, the feature is disabled\&. When greater than zero, the feature is enabled\&. When less than zero, the feature is reset to the distribution\*(Aqs default\&. The
311 \fIflags\fR
312 argument is added for future extensibility, and must be set to 0\&. The feature does not have to exist; this allows for graceful handling of masked features, and for preemptive decisions to be made about features that are planned to appear in future releases of the OS\&. The drop\-in will have a filename of
313 "50\-systemd\-sysupdate\-enabled\&.conf"\&. This method only changes configuration files; to actually apply the changes, clients will need to call
314 \fBUpdate()\fR\&. Depending on the exact needs of the client, it can choose to update the system to the latest available version, or it can extend the newest existing installation in\-place (by passing in the version returned by
315 \fIGetVersion()\fR)\&. For now, this method only works with the
316 "host"
317 target\&.
318 .SS "Properties"
319 .PP
320 The
321 \fIClass\fR
322 property exposes the class of this target, which describes where it was enumerated\&. Possible values include:
323 "machine"
324 for containers and virtual machines managed by
325 \fBsystemd-machined.service\fR(8),
326 "portable"
327 for
328 \m[blue]\fBportable services\fR\m[]\&\s-2\u[3]\d\s+2,
329 "sysext"
330 for system extensions managed by
331 \fBsystemd-sysext\fR(8),
332 "confext"
333 for configuration extensions managed by
334 \fBsystemd-confext\fR(8),
335 "component"
336 for components accepted by the
337 \fB\-\-component=\fR
338 option of
339 \fBsystemd-sysupdate\fR(8), and
340 "host"
341 for the host system itself\&. At most one target will have a class of
342 "host"\&.
343 .PP
344 The
345 \fIPath\fR
346 property exposes more detail about where this target was found\&. For
347 "machine",
348 "portable",
349 "extension", and
350 "confext"
351 targets, this is the file path to the image\&. For
352 "component"
353 and
354 "host"
355 targets, this is the name of a
356 \fBsysupdate.d\fR(5)
357 directory\&.
358 .PP
359 The
360 \fIName\fR
361 property exposes the name of this target\&. Note that the name is unique within a class but is not necessarily unique between classes\&. For instance, it is possible to have both a
362 "portable"
363 target named
364 "foobar"
365 and an
366 "extension"
367 target named
368 "foobar", but it is not possible to have two
369 "portable"
370 targets named
371 "foobar"\&.
372 .SS "Security"
373 .PP
374 Method calls on this service are authenticated via
375 \m[blue]\fBpolkit\fR\m[]\&\s-2\u[4]\d\s+2\&.
376 .PP
377 \fBList()\fR,
378 \fBDescribe()\fR, and
379 \fBCheckNew()\fR
380 use the polkit action
381 org\&.freedesktop\&.sysupdate1\&.check\&. By default, this action is permitted without administrator authentication\&.
382 .PP
383 \fBUpdate()\fR
384 uses the polkit action
385 org\&.freedesktop\&.sysupdate1\&.update
386 when no version is specified\&. By default, this action is permitted without administrator authentication\&. When a version is specified,
387 org\&.freedesktop\&.sysupdate1\&.update\-to\-version
388 is used instead\&. By default, this alternate action requires administrator authentication\&.
389 .PP
390 \fBVacuum()\fR
391 uses the polkit action
392 org\&.freedesktop\&.sysupdate1\&.vacuum\&. By default, this action requires administrator authentication\&.
393 .PP
394 \fBSetFeatureEnabled()\fR
395 uses the polkit action
396 org\&.freedesktop\&.sysupdate1\&.manage\-features\&. By default, this action requires administrator authentication\&.
397 .PP
398 \fBGetAppStream()\fR,
399 \fBGetVersion()\fR,
400 \fBListFeatures()\fR, and
401 \fBDescribeFeature()\fR
402 are unauthenticated and may be called by anybody\&.
403 .PP
404 All methods called on this interface expose additional variables to the polkit rules\&.
405 "class"
406 contains the class of the Target being acted upon, and
407 "name"
408 contains the name of the same Target\&. Additionally, each method exposes its arguments to the rule\&. Flags are mapped as follows:
409 .sp
410 .RS 4
411 .ie n \{\
412 \h'-04'\(bu\h'+03'\c
413 .\}
414 .el \{\
415 .sp -1
416 .IP \(bu 2.3
417 .\}
418 \fBSD_SYSUPDATE_OFFLINE\fR
419 →
420 "update"
421 .RE
422 .SH "THE JOB OBJECT"
423 .PP
424 A job is an ongoing operation, started by one of the methods on a Target object\&.
425 .PP
426 The service exposes the following interfaces on Job objects on the bus:
427 .sp
428 .if n \{\
429 .RS 4
430 .\}
431 .nf
432 node /org/freedesktop/sysupdate1/job/_1 {
433 interface org\&.freedesktop\&.sysupdate1\&.Job {
434 methods:
435 Cancel();
436 properties:
437 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
438 readonly t Id = \&.\&.\&.;
439 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
440 readonly s Type = \*(Aq\&.\&.\&.\*(Aq;
441 @org\&.freedesktop\&.DBus\&.Property\&.EmitsChangedSignal("const")
442 readonly b Offline = \&.\&.\&.;
443 readonly u Progress = \&.\&.\&.;
444 };
445 interface org\&.freedesktop\&.DBus\&.Peer { \&.\&.\&. };
446 interface org\&.freedesktop\&.DBus\&.Introspectable { \&.\&.\&. };
447 interface org\&.freedesktop\&.DBus\&.Properties { \&.\&.\&. };
448 };
449 .fi
450 .if n \{\
451 .RE
452 .\}
453
454
455
456
457
458
459 .SS "Methods"
460 .PP
461 The
462 \fBCancel()\fR
463 method may be used to cancel the job\&. It takes no parameters\&.
464 .SS "Properties"
465 .PP
466 The
467 \fIId\fR
468 property exposes the numeric job ID of the job object\&.
469 .PP
470 The
471 \fIType\fR
472 property exposes the type of operation (one of:
473 "list",
474 "describe",
475 "check\-new",
476 "update",
477 "vacuum", or
478 "describe\-feature")\&.
479 .PP
480 The
481 \fIOffline\fR
482 property exposes whether the job is permitted to access the network or not\&.
483 .PP
484 The
485 \fIProgress\fR
486 property exposes the current progress of the job as a value between 0 and 100\&. It is only available for
487 "update"
488 jobs; for all other jobs it is always 0\&.
489 .SS "Security"
490 .PP
491 \fBCancel()\fR
492 uses the polkit action that corresponds to the method that started this job\&. For instance, trying to cancel a
493 "list"
494 job will require polkit to permit the
495 org\&.freedesktop\&.sysupdate1\&.check
496 action\&.
497 .SH "EXAMPLES"
498 .PP
499 \fBExample\ \&1.\ \&Introspect org\&.freedesktop\&.sysupdate1\&.Manager on the bus\fR
500 .sp
501 .if n \{\
502 .RS 4
503 .\}
504 .nf
505 $ gdbus introspect \-\-system \e
506 \-\-dest org\&.freedesktop\&.sysupdate1 \e
507 \-\-object\-path /org/freedesktop/sysupdate1
508 .fi
509 .if n \{\
510 .RE
511 .\}
512 .PP
513 \fBExample\ \&2.\ \&Introspect org\&.freedesktop\&.sysupdate1\&.Target on the bus\fR
514 .sp
515 .if n \{\
516 .RS 4
517 .\}
518 .nf
519 $ gdbus introspect \-\-system \e
520 \-\-dest org\&.freedesktop\&.sysupdate1 \e
521 \-\-object\-path /org/freedesktop/sysupdate1/target/host
522 .fi
523 .if n \{\
524 .RE
525 .\}
526 .PP
527 \fBExample\ \&3.\ \&Introspect org\&.freedesktop\&.sysupdate1\&.Job on the bus\fR
528 .sp
529 .if n \{\
530 .RS 4
531 .\}
532 .nf
533 $ gdbus introspect \-\-system \e
534 \-\-dest org\&.freedesktop\&.sysupdate1 \e
535 \-\-object\-path /org/freedesktop/sysupdate1/job/_1
536 .fi
537 .if n \{\
538 .RE
539 .\}
540 .SH "VERSIONING"
541 .PP
542 These D\-Bus interfaces follow
543 \m[blue]\fBthe usual interface versioning guidelines\fR\m[]\&\s-2\u[5]\d\s+2\&.
544 .SH "HISTORY"
545 .SS "The Manager Object"
546 .PP
547 \fBListTargets()\fR,
548 \fBListJobs()\fR,
549 \fBListAppStream()\fR, and
550 \fBJobRemoved()\fR
551 were added in version 257\&.
552 .SS "The Target Object"
553 .PP
554 \fBList()\fR,
555 \fBDescribe()\fR,
556 \fBCheckNew()\fR,
557 \fBUpdate()\fR,
558 \fBVacuum()\fR,
559 \fBGetAppStream()\fR,
560 \fBGetVersion()\fR,
561 \fBListFeatures()\fR,
562 \fBDescribeFeature()\fR,
563 \fBSetFeatureEnabled()\fR,
564 \fIClass\fR,
565 \fIName\fR, and
566 \fIPath\fR
567 were added in version 257\&.
568 .SS "The Job Object"
569 .PP
570 \fBCancel()\fR,
571 \fIId\fR,
572 \fIType\fR,
573 \fIOffline\fR, and
574 \fIProgress\fR
575 were added in version 257\&.
576 .SH "SEE ALSO"
577 .PP
578 \fBsystemd\fR(1), \fBsystemd-sysupdated.service\fR(8), \fBupdatectl\fR(1)
579 .SH "NOTES"
580 .IP " 1." 4
581 appstream catalog
582 .RS 4
583 \%https://wwww.freedesktop.org/software/appstream/docs/chap-CatalogData.html
584 .RE
585 .IP " 2." 4
586 special metadata
587 .RS 4
588 \%https://systemd.io/APPSTREAM_BUNDLE
589 .RE
590 .IP " 3." 4
591 portable services
592 .RS 4
593 \%https://systemd.io/PORTABLE_SERVICES
594 .RE
595 .IP " 4." 4
596 polkit
597 .RS 4
598 \%https://www.freedesktop.org/software/polkit/docs/latest/
599 .RE
600 .IP " 5." 4
601 the usual interface versioning guidelines
602 .RS 4
603 \%https://0pointer.de/blog/projects/versioning-dbus.html
604 .RE