From 607f032858dd1c123481e37d00391029c5b54001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 20 Jan 2022 16:45:19 +0100 Subject: 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. --- man/systemd.unit.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'man') 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 not influenced by the Us + + %y + The path to the fragment + 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. + + + %Y + The directory of the fragment + This is the directory part of %y. + -- cgit v1.2.1