summaryrefslogtreecommitdiffstats
path: root/man/systemd.unit.xml
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-01-20 16:45:19 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-01-21 08:00:41 +0100
commit607f032858dd1c123481e37d00391029c5b54001 (patch)
tree790789ced94375525471a156979d4eaefd6b8c12 /man/systemd.unit.xml
parentshared/specifier: treat NULL the same as "" (diff)
downloadsystemd-607f032858dd1c123481e37d00391029c5b54001.tar.xz
systemd-607f032858dd1c123481e37d00391029c5b54001.zip
core: add %y/%Y specifiers for the fragment path of the unit
Fixes #6308: people want to be able to link a unit file via 'systemctl enable' from a git checkout or such and refer to other files in the same repo. The new specifiers make that easy. %y/%Y is used because other more obvious choices like %d/%D or %p/%P are not available because at least on of the two letters is already used. The new specifiers are only available in units. Technically it would be trivial to add then in [Install] too, but I don't see how they could be useful, so I didn't do that. I added both %y and %Y because both were requested in the issue, and because I think both could be useful, depending on the case. %Y to refer to other files in the same repo, and %y in the case where a single repo has multiple unit files, and e.g. each unit has some corresponding asset named after the unit file.
Diffstat (limited to 'man/systemd.unit.xml')
-rw-r--r--man/systemd.unit.xml10
1 files changed, 10 insertions, 0 deletions
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 2a44b8cfd8..72a6ba0a7d 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -2098,6 +2098,16 @@ Note that this setting is <emphasis>not</emphasis> influenced by the <varname>Us
<xi:include href="standard-specifiers.xml" xpointer="V"/>
<xi:include href="standard-specifiers.xml" xpointer="w"/>
<xi:include href="standard-specifiers.xml" xpointer="W"/>
+ <row>
+ <entry><literal>%y</literal></entry>
+ <entry>The path to the fragment</entry>
+ <entry>This is the path where the main part of the unit file is located. For linked unit files, the real path outside of the unit search directories is used. For units that don't have a fragment file, this specifier will raise an error.</entry>
+ </row>
+ <row>
+ <entry><literal>%Y</literal></entry>
+ <entry>The directory of the fragment</entry>
+ <entry>This is the directory part of <literal>%y</literal>.</entry>
+ </row>
<xi:include href="standard-specifiers.xml" xpointer="percent"/>
</tbody>
</tgroup>