Skip to content

Commit 83f72cd

Browse files
committed
man,docs: document the new unit file directory for attached images
1 parent 339731d commit 83f72cd

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

docs/PORTABLE_SERVICES.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,17 @@ This command does the following:
9898
`foobar@.{service|socket|target|timer|path}` as well as
9999
`foobar.*.{service|socket|target|timer|path}` and
100100
`foobar.{service|socket|target|timer|path}` are copied out. These unit files
101-
are placed in `/etc/systemd/system/` like regular unit files. Within the
102-
images the unit files are looked for at the usual locations, i.e. in
103-
`/usr/lib/systemd/system/` and `/etc/systemd/system/` and so on, relative to
104-
the image's root.
101+
are placed in `/etc/systemd/system.attached/` (which is part of the normal
102+
unit file search path of PID 1, and thus loaded exactly like regular unit
103+
files). Within the images the unit files are looked for at the usual
104+
locations, i.e. in `/usr/lib/systemd/system/` and `/etc/systemd/system/` and
105+
so on, relative to the image's root.
105106

106107
3. For each such unit file a drop-in file is created. Let's say
107108
`foobar-waldo.service` was one of the unit files copied to
108-
`/etc/systemd/system/`, then a drop-in file
109-
`/etc/systemd/system/foobar-waldo.service.d/20-portable.conf` is created,
110-
containing a few lines of additional configuration:
109+
`/etc/systemd/system.attached/`, then a drop-in file
110+
`/etc/systemd/system.attached/foobar-waldo.service.d/20-portable.conf` is
111+
created, containing a few lines of additional configuration:
111112

112113
```
113114
[Service]

man/portablectl.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
<term><option>--runtime</option></term>
102102

103103
<listitem><para>When specified the unit and drop-in files are placed in
104-
<filename>/run/systemd/system/</filename> instead of <filename>/etc/systemd/system/</filename>. Images attached
105-
with this option set hence remain attached only until the next reboot, while they are normally attached
106-
persistently.</para></listitem>
104+
<filename>/run/systemd/system.attached/</filename> instead of
105+
<filename>/etc/systemd/system.attached/</filename>. Images attached with this option set hence remain attached
106+
only until the next reboot, while they are normally attached persistently.</para></listitem>
107107
</varlistentry>
108108

109109
<varlistentry>
@@ -167,8 +167,10 @@
167167
<listitem><para>All unit files of types <filename>.service</filename>, <filename>.socket</filename>,
168168
<filename>.target</filename>, <filename>.timer</filename> and <filename>.path</filename> which match the
169169
indicated unit file name prefix are copied from the image to the host's
170-
<filename>/etc/systemd/system/</filename> directory (or <filename>/run/systemd/system/</filename> — depending
171-
whether <option>--runtime</option> is specified, see above).</para></listitem>
170+
<filename>/etc/systemd/system.attached/</filename> directory (or
171+
<filename>/run/systemd/system.attached/</filename> — depending whether <option>--runtime</option> is
172+
specified, see above), which is included in the built-in unit search path of the system service
173+
manager.</para></listitem>
172174

173175
<listitem><para>For unit files of type <filename>.service</filename> a drop-in is added to these copies that
174176
adds <varname>RootDirectory=</varname> or <varname>RootImage=</varname> settings (see
@@ -330,6 +332,10 @@
330332
to place image files directly in <filename>/etc/portables/</filename> or
331333
<filename>/run/systemd/portables/</filename> (as these are generally not suitable for storing large or non-textual
332334
data), but use these directories only for linking images located elsewhere into the image search path.</para>
335+
336+
<para>When a portable service image is attached, matching unit files are copied onto the host into the
337+
<filename>/etc/systemd/system.attached/</filename> and <filename>/run/systemd/system.attached/</filename>
338+
directories. When an image is detached, the unit files are removed again from these directories.</para>
333339
</refsect1>
334340

335341
<refsect1>

man/systemd.unit.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
<filename>/run/systemd/transient/*</filename>
4545
<filename>/run/systemd/generator.early/*</filename>
4646
<filename>/etc/systemd/system/*</filename>
47+
<filename>/etc/systemd/systemd.attached/*</filename>
4748
<filename>/run/systemd/system/*</filename>
49+
<filename>/run/systemd/systemd.attached/*</filename>
4850
<filename>/run/systemd/generator/*</filename>
4951
<filename>…</filename>
5052
<filename>/usr/lib/systemd/system/*</filename>

0 commit comments

Comments
 (0)