]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/org.freedesktop.portable1.xml
Merge pull request #28919 from fbuihuu/custom-config-file-install-path
[thirdparty/systemd.git] / man / org.freedesktop.portable1.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="org.freedesktop.portable1" conditional='ENABLE_PORTABLED'
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8 <refentryinfo>
9 <title>org.freedesktop.portable1</title>
10 <productname>systemd</productname>
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>org.freedesktop.portable1</refentrytitle>
15 <manvolnum>5</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>org.freedesktop.portable1</refname>
20 <refpurpose>The D-Bus interface of systemd-portabled</refpurpose>
21 </refnamediv>
22
23 <refsect1>
24 <title>Introduction</title>
25
26 <para>
27 <citerefentry><refentrytitle>systemd-portabled.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
28 is a system service that may be used to attach, detach and inspect portable services. This page describes the
29 D-Bus interface.</para>
30 </refsect1>
31
32 <refsect1>
33 <title>The Manager Object</title>
34
35 <para>The service exposes the following interfaces on the Manager object on the bus:</para>
36
37 <programlisting executable="systemd-portabled" node="/org/freedesktop/portable1" interface="org.freedesktop.portable1.Manager">
38 node /org/freedesktop/portable1 {
39 interface org.freedesktop.portable1.Manager {
40 methods:
41 GetImage(in s image,
42 out o object);
43 ListImages(out a(ssbtttso) images);
44 GetImageOSRelease(in s image,
45 out a{ss} os_release);
46 GetImageMetadata(in s image,
47 in as matches,
48 out s image,
49 out ay os_release,
50 out a{say} units);
51 GetImageMetadataWithExtensions(in s image,
52 in as extensions,
53 in as matches,
54 in t flags,
55 out s image,
56 out ay os_release,
57 out a{say} extensions,
58 out a{say} units);
59 GetImageState(in s image,
60 out s state);
61 GetImageStateWithExtensions(in s image,
62 in as extensions,
63 in t flags,
64 out s state);
65 AttachImage(in s image,
66 in as matches,
67 in s profile,
68 in b runtime,
69 in s copy_mode,
70 out a(sss) changes);
71 AttachImageWithExtensions(in s image,
72 in as extensions,
73 in as matches,
74 in s profile,
75 in s copy_mode,
76 in t flags,
77 out a(sss) changes);
78 DetachImage(in s image,
79 in b runtime,
80 out a(sss) changes);
81 DetachImageWithExtensions(in s image,
82 in as extensions,
83 in t flags,
84 out a(sss) changes);
85 ReattachImage(in s image,
86 in as matches,
87 in s profile,
88 in b runtime,
89 in s copy_mode,
90 out a(sss) changes_removed,
91 out a(sss) changes_updated);
92 ReattachImageWithExtensions(in s image,
93 in as extensions,
94 in as matches,
95 in s profile,
96 in s copy_mode,
97 in t flags,
98 out a(sss) changes_removed,
99 out a(sss) changes_updated);
100 RemoveImage(in s image);
101 MarkImageReadOnly(in s image,
102 in b read_only);
103 SetImageLimit(in s image,
104 in t limit);
105 SetPoolLimit(in t limit);
106 properties:
107 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
108 readonly s PoolPath = '...';
109 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
110 readonly t PoolUsage = ...;
111 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
112 readonly t PoolLimit = ...;
113 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
114 readonly as Profiles = ['...', ...];
115 };
116 interface org.freedesktop.DBus.Peer { ... };
117 interface org.freedesktop.DBus.Introspectable { ... };
118 interface org.freedesktop.DBus.Properties { ... };
119 };
120 </programlisting>
121
122 <!--Autogenerated cross-references for systemd.directives, do not edit-->
123
124 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.portable1.Manager"/>
125
126 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.portable1.Manager"/>
127
128 <variablelist class="dbus-method" generated="True" extra-ref="GetImage()"/>
129
130 <variablelist class="dbus-method" generated="True" extra-ref="ListImages()"/>
131
132 <variablelist class="dbus-method" generated="True" extra-ref="GetImageOSRelease()"/>
133
134 <variablelist class="dbus-method" generated="True" extra-ref="GetImageMetadata()"/>
135
136 <variablelist class="dbus-method" generated="True" extra-ref="GetImageMetadataWithExtensions()"/>
137
138 <variablelist class="dbus-method" generated="True" extra-ref="GetImageState()"/>
139
140 <variablelist class="dbus-method" generated="True" extra-ref="GetImageStateWithExtensions()"/>
141
142 <variablelist class="dbus-method" generated="True" extra-ref="AttachImage()"/>
143
144 <variablelist class="dbus-method" generated="True" extra-ref="AttachImageWithExtensions()"/>
145
146 <variablelist class="dbus-method" generated="True" extra-ref="DetachImage()"/>
147
148 <variablelist class="dbus-method" generated="True" extra-ref="DetachImageWithExtensions()"/>
149
150 <variablelist class="dbus-method" generated="True" extra-ref="ReattachImage()"/>
151
152 <variablelist class="dbus-method" generated="True" extra-ref="ReattachImageWithExtensions()"/>
153
154 <variablelist class="dbus-method" generated="True" extra-ref="RemoveImage()"/>
155
156 <variablelist class="dbus-method" generated="True" extra-ref="MarkImageReadOnly()"/>
157
158 <variablelist class="dbus-method" generated="True" extra-ref="SetImageLimit()"/>
159
160 <variablelist class="dbus-method" generated="True" extra-ref="SetPoolLimit()"/>
161
162 <variablelist class="dbus-property" generated="True" extra-ref="PoolPath"/>
163
164 <variablelist class="dbus-property" generated="True" extra-ref="PoolUsage"/>
165
166 <variablelist class="dbus-property" generated="True" extra-ref="PoolLimit"/>
167
168 <variablelist class="dbus-property" generated="True" extra-ref="Profiles"/>
169
170 <!--End of Autogenerated section-->
171
172 <refsect2>
173 <title>Methods</title>
174
175 <para><function>GetImage()</function> may be used to get the image object path of the image with the
176 specified name.</para>
177
178 <para><function>ListImages()</function> returns an array of all currently known images. The
179 structures in the array consist of the following fields: image name, type, read-only flag, creation
180 time, modification time, current disk space, usage and image object path.</para>
181
182 <para><function>GetImageOSRelease()</function> retrieves the OS release information of an image.
183 This method returns an array of key value pairs read from the
184 <citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry> file in
185 the image and is useful to identify the operating system used in a portable service.</para>
186
187 <para><function>GetImageMetadata()</function> retrieves metadata associated with an image.
188 This method returns the image name, the image's <citerefentry><refentrytitle>os-release</refentrytitle>
189 <manvolnum>5</manvolnum></citerefentry> content in the form of a (streamable) array of bytes,
190 and a list of portable units contained in the image, in the form of a string (unit name) and
191 an array of bytes with the content.</para>
192
193 <para><function>GetImageMetadataWithExtensions()</function> retrieves metadata associated with an
194 image. This method is a superset of <function>GetImageMetadata()</function> with the addition of a list
195 of extensions as input parameter, which were overlaid on top of the main image via
196 <function>AttachImageWithExtensions()</function>. The path of each extension and an array of bytes with
197 the content of the respective extension-release file are returned, one such structure for each
198 extension named in the input arguments.</para>
199
200 <para><function>GetImageState()</function> retrieves the image state as one of the following
201 strings:
202 <itemizedlist>
203 <listitem><para>detached</para></listitem>
204
205 <listitem><para>attached</para></listitem>
206
207 <listitem><para>attached-runtime</para></listitem>
208
209 <listitem><para>enabled</para></listitem>
210
211 <listitem><para>enabled-runtime</para></listitem>
212
213 <listitem><para>running</para></listitem>
214
215 <listitem><para>running-runtime</para></listitem>
216 </itemizedlist></para>
217
218 <para><function>GetImageStateWithExtensions()</function> is a superset of
219 <function>GetImageState()</function>, with additional support for a list of extensions
220 as input parameters, which is necessary to query the state in case the image was attached
221 in that particular way. The <varname>flag</varname> parameter is currently unused and
222 reserved for future purposes.</para>
223
224 <para><function>AttachImage()</function> attaches a portable image to the system.
225 This method takes an image path or name, a list of strings that will be used to search for
226 unit files inside the image (partial or complete matches), a string indicating which
227 portable profile to use for the image (see <varname>Profiles</varname> property for
228 a list of available profiles), a boolean indicating whether to attach the image only
229 for the current boot session, and a string representing the preferred copy mode
230 (whether to copy the image or to just symlink it) with the following possible values:
231 <itemizedlist>
232 <listitem><para>(null)</para></listitem>
233
234 <listitem><para>copy</para></listitem>
235
236 <listitem><para>symlink</para></listitem>
237 </itemizedlist>
238 This method returns the list of changes applied to the system (for example, which unit was
239 added and is now available as a system service). Each change is represented as a triplet of
240 strings: the type of change applied, the path on which it was applied, and the source
241 (if any). The type of change applied will be one of the following possible values:
242 <itemizedlist>
243 <listitem><para>copy</para></listitem>
244
245 <listitem><para>symlink</para></listitem>
246
247 <listitem><para>write</para></listitem>
248
249 <listitem><para>mkdir</para></listitem>
250 </itemizedlist>
251 Note that an image cannot be attached if a unit that it contains is already present
252 on the system.</para>
253
254 <para><function>AttachImageWithExtensions()</function> attaches a portable image to the system.
255 This method is a superset of <function>AttachImage()</function> with the addition of
256 a list of extensions as input parameter, which will be overlaid on top of the main
257 image. When this method is used, detaching must be done by passing the same arguments via the
258 <function>DetachImageWithExtensions()</function> method. For more details on this functionality,
259 see the <varname>MountImages=</varname> entry on
260 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
261 and <citerefentry><refentrytitle>systemd-sysext</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
262 </para>
263
264 <para><function>DetachImage()</function> detaches a portable image from the system.
265 This method takes an image path or name, and a boolean indicating whether the image to
266 detach was attached only for the current boot session or persistently. This method
267 returns the list of changes applied to the system (for example, which unit was removed
268 and is no longer available as a system service). Each change is represented as a triplet of
269 strings: the type of change applied, the path on which it was applied, and the source
270 (if any). The type of change applied will be one of the following possible values:
271 <itemizedlist>
272 <listitem><para>unlink</para></listitem>
273 </itemizedlist>
274 Note that an image cannot be detached if a unit that it contains is running.</para>
275
276 <para><function>DetachImageWithExtensions()</function> detaches a portable image from the system.
277 This method is a superset of <function>DetachImage()</function> with the addition of
278 a list of extensions as input parameter, which were overlaid on top of the main
279 image via <function>AttachImageWithExtensions()</function>.
280 The <varname>flag</varname> parameter is currently unused and reserved for future purposes.</para>
281
282 <para><function>ReattachImage()</function> combines the effects of the
283 <function>AttachImage()</function> method and the <function>DetachImage()</function> method.
284 The difference is that it is allowed to reattach an image while one or more of its units
285 are running. The reattach operation will fail if no matching image is attached.
286 The input parameters match the <function>AttachImage()</function> method, and the return
287 parameters are the combination of the return parameters of the
288 <function>DetachImage()</function> method (first array, units that were removed) and the
289 <function>AttachImage()</function> method (second array, units that were updated or added).</para>
290
291 <para><function>ReattachImageWithExtensions()</function> reattaches a portable image to the system.
292 This method is a superset of <function>ReattachImage()</function> with the addition of
293 a list of extensions as input parameter, which will be overlaid on top of the main
294 image. For more details on this functionality, see the <varname>MountImages=</varname> entry on
295 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
296 and <citerefentry><refentrytitle>systemd-sysext</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
297 The <varname>flag</varname> parameter is currently unused and reserved for future purposes</para>
298
299 <para><function>RemoveImage()</function> removes the image with the specified name.</para>
300
301 <para><function>MarkImageReadOnly()</function> toggles the read-only flag of an image.</para>
302
303 <para><function>SetPoolLimit()</function> sets an overall quota limit on the pool of images.</para>
304
305 <para><function>SetImageLimit()</function> sets a per-image quota limit.</para>
306
307 <para>The <function>AttachImageWithExtensions()</function>,
308 <function>DetachImageWithExtensions()</function> and
309 <function>ReattachImageWithExtensions()</function> methods take in options as flags instead of
310 booleans to allow for extendability. <varname>SD_SYSTEMD_PORTABLE_FORCE_ATTACH</varname> will cause
311 safety checks that ensure the units are not running while the new image is attached or detached
312 to be skipped. <varname>SD_SYSTEMD_PORTABLE_FORCE_SYSEXT</varname> will cause the check that the
313 <filename>extension-release.<replaceable>NAME</replaceable></filename> file in the extension image
314 matches the image name to be skipped. They are defined as follows:</para>
315
316 <programlisting>
317 #define SD_SYSTEMD_PORTABLE_RUNTIME (UINT64_C(1) &lt;&lt; 0)
318 #define SD_SYSTEMD_PORTABLE_FORCE_ATTACH (UINT64_C(1) &lt;&lt; 1)
319 #define SD_SYSTEMD_PORTABLE_FORCE_SYSEXT (UINT64_C(1) &lt;&lt; 2)
320 </programlisting>
321 </refsect2>
322
323 <refsect2>
324 <title>Properties</title>
325
326 <para><varname>PoolPath</varname> specifies the file system path where images are written to.</para>
327
328 <para><varname>PoolUsage</varname> specifies the current usage size of the image pool in bytes.</para>
329
330 <para><varname>PoolLimit</varname> specifies the size limit of the image pool in bytes.</para>
331
332 <para><varname>Profiles</varname> specifies the available runtime profiles for portable services.</para>
333 </refsect2>
334 </refsect1>
335
336 <refsect1>
337 <title>The Image Object</title>
338
339 <para>The service exposes the following interfaces on the Image object on the bus:</para>
340
341 <programlisting executable="systemd-portabled" node="/org/freedesktop/portable1" interface="org.freedesktop.portable1.Image">
342 node /org/freedesktop/portable1 {
343 interface org.freedesktop.portable1.Image {
344 methods:
345 GetOSRelease(out a{ss} os_release);
346 GetMetadata(in as matches,
347 out s image,
348 out ay os_release,
349 out a{say} units);
350 GetMetadataWithExtensions(in as extensions,
351 in as matches,
352 in t flags,
353 out s image,
354 out ay os_release,
355 out a{say} extensions,
356 out a{say} units);
357 GetState(out s state);
358 GetStateWithExtensions(in as extensions,
359 in t flags,
360 out s state);
361 Attach(in as matches,
362 in s profile,
363 in b runtime,
364 in s copy_mode,
365 out a(sss) changes);
366 AttachWithExtensions(in as extensions,
367 in as matches,
368 in s profile,
369 in s copy_mode,
370 in t flags,
371 out a(sss) changes);
372 Detach(in b runtime,
373 out a(sss) changes);
374 DetachWithExtensions(in as extensions,
375 in t flags,
376 out a(sss) changes);
377 Reattach(in as matches,
378 in s profile,
379 in b runtime,
380 in s copy_mode,
381 out a(sss) changes_removed,
382 out a(sss) changes_updated);
383 ReattachWithExtensions(in as extensions,
384 in as matches,
385 in s profile,
386 in s copy_mode,
387 in t flags,
388 out a(sss) changes_removed,
389 out a(sss) changes_updated);
390 Remove();
391 MarkReadOnly(in b read_only);
392 SetLimit(in t limit);
393 properties:
394 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
395 readonly s Name = '...';
396 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
397 readonly s Path = '...';
398 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
399 readonly s Type = '...';
400 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
401 readonly b ReadOnly = ...;
402 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
403 readonly t CreationTimestamp = ...;
404 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
405 readonly t ModificationTimestamp = ...;
406 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
407 readonly t Usage = ...;
408 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
409 readonly t Limit = ...;
410 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
411 readonly t UsageExclusive = ...;
412 @org.freedesktop.DBus.Property.EmitsChangedSignal("false")
413 readonly t LimitExclusive = ...;
414 };
415 interface org.freedesktop.DBus.Peer { ... };
416 interface org.freedesktop.DBus.Introspectable { ... };
417 interface org.freedesktop.DBus.Properties { ... };
418 };
419 </programlisting>
420
421 <!--method GetOSRelease is not documented!-->
422
423 <!--method GetMetadata is not documented!-->
424
425 <!--method GetMetadataWithExtensions is not documented!-->
426
427 <!--method GetState is not documented!-->
428
429 <!--method GetStateWithExtensions is not documented!-->
430
431 <!--method Attach is not documented!-->
432
433 <!--method AttachWithExtensions is not documented!-->
434
435 <!--method Detach is not documented!-->
436
437 <!--method DetachWithExtensions is not documented!-->
438
439 <!--method Reattach is not documented!-->
440
441 <!--method ReattachWithExtensions is not documented!-->
442
443 <!--method Remove is not documented!-->
444
445 <!--method MarkReadOnly is not documented!-->
446
447 <!--method SetLimit is not documented!-->
448
449 <!--Autogenerated cross-references for systemd.directives, do not edit-->
450
451 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.portable1.Image"/>
452
453 <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.portable1.Image"/>
454
455 <variablelist class="dbus-method" generated="True" extra-ref="GetOSRelease()"/>
456
457 <variablelist class="dbus-method" generated="True" extra-ref="GetMetadata()"/>
458
459 <variablelist class="dbus-method" generated="True" extra-ref="GetMetadataWithExtensions()"/>
460
461 <variablelist class="dbus-method" generated="True" extra-ref="GetState()"/>
462
463 <variablelist class="dbus-method" generated="True" extra-ref="GetStateWithExtensions()"/>
464
465 <variablelist class="dbus-method" generated="True" extra-ref="Attach()"/>
466
467 <variablelist class="dbus-method" generated="True" extra-ref="AttachWithExtensions()"/>
468
469 <variablelist class="dbus-method" generated="True" extra-ref="Detach()"/>
470
471 <variablelist class="dbus-method" generated="True" extra-ref="DetachWithExtensions()"/>
472
473 <variablelist class="dbus-method" generated="True" extra-ref="Reattach()"/>
474
475 <variablelist class="dbus-method" generated="True" extra-ref="ReattachWithExtensions()"/>
476
477 <variablelist class="dbus-method" generated="True" extra-ref="Remove()"/>
478
479 <variablelist class="dbus-method" generated="True" extra-ref="MarkReadOnly()"/>
480
481 <variablelist class="dbus-method" generated="True" extra-ref="SetLimit()"/>
482
483 <variablelist class="dbus-property" generated="True" extra-ref="Name"/>
484
485 <variablelist class="dbus-property" generated="True" extra-ref="Path"/>
486
487 <variablelist class="dbus-property" generated="True" extra-ref="Type"/>
488
489 <variablelist class="dbus-property" generated="True" extra-ref="ReadOnly"/>
490
491 <variablelist class="dbus-property" generated="True" extra-ref="CreationTimestamp"/>
492
493 <variablelist class="dbus-property" generated="True" extra-ref="ModificationTimestamp"/>
494
495 <variablelist class="dbus-property" generated="True" extra-ref="Usage"/>
496
497 <variablelist class="dbus-property" generated="True" extra-ref="Limit"/>
498
499 <variablelist class="dbus-property" generated="True" extra-ref="UsageExclusive"/>
500
501 <variablelist class="dbus-property" generated="True" extra-ref="LimitExclusive"/>
502
503 <!--End of Autogenerated section-->
504
505 <refsect2>
506 <title>Methods</title>
507
508 <para>The following methods implement the same operation as the respective methods on the
509 <interfacename>Manager</interfacename> object (see above). However, these methods operate on the image
510 object and hence does not take an image name parameter. Invoking the methods directly on the Manager
511 object has the advantage of not requiring a <function>GetImage()</function> call to get the image object
512 for a specific image name. Calling the methods on the Manager object is hence a round trip
513 optimization. List of methods:
514 <itemizedlist>
515 <listitem><para>GetOSRelease()</para></listitem>
516
517 <listitem><para>GetMetadata()</para></listitem>
518
519 <listitem><para>GetMetadataWithExtensions()</para></listitem>
520
521 <listitem><para>GetState()</para></listitem>
522
523 <listitem><para>Attach()</para></listitem>
524
525 <listitem><para>AttachWithExtensions()</para></listitem>
526
527 <listitem><para>Detach()</para></listitem>
528
529 <listitem><para>DetachWithExtensions()</para></listitem>
530
531 <listitem><para>Reattach()</para></listitem>
532
533 <listitem><para>ReattachWithExtensions()</para></listitem>
534
535 <listitem><para>Remove()</para></listitem>
536
537 <listitem><para>MarkReadOnly()</para></listitem>
538
539 <listitem><para>SetLimit()</para></listitem>
540 </itemizedlist></para>
541 </refsect2>
542
543 <refsect2>
544 <title>Properties</title>
545
546 <para><varname>Name</varname> specifies the image name.</para>
547
548 <para><varname>Path</varname> specifies the file system path where image is stored.</para>
549
550 <para><varname>Type</varname> specifies the image type.</para>
551
552 <para><varname>ReadOnly</varname> specifies whether the image is read-only.</para>
553
554 <para><varname>CreationTimestamp</varname> specifies the image creation timestamp.</para>
555
556 <para><varname>ModificationTimestamp</varname> specifies the image modification timestamp.</para>
557
558 <para><varname>Usage</varname> specifies the image disk usage.</para>
559
560 <para><varname>Limit</varname> specifies the image disk usage limit.</para>
561
562 <para><varname>UsageExclusive</varname> specifies the image disk usage (exclusive).</para>
563
564 <para><varname>LimitExclusive</varname> specifies the image disk usage limit (exclusive).</para>
565 </refsect2>
566 </refsect1>
567
568 <xi:include href="org.freedesktop.locale1.xml" xpointer="versioning"/>
569
570 <refsect1>
571 <title>History</title>
572 <refsect2>
573 <title>The Manager Object</title>
574 <para><function>GetImageStateWithExtensions()</function> was added in version 251.</para>
575 </refsect2>
576 <refsect2>
577 <title>The Image Object</title>
578 <para><function>GetStateWithExtensions()</function> was added in version 251.</para>
579 <para><function>ReattachWithExtensions()</function> was added in version 254.</para>
580 </refsect2>
581 </refsect1>
582 </refentry>