aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2018-12-20 08:59:18 -0600
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-12-22 17:21:13 +0900
commit8eab766804ef4fa21d26c00fd0baab3f1a47bb5c (patch)
tree1c305649abe3842060577d91fa1106bdd8698909 /src
parentNEWS: add one more name and adjust location (diff)
downloadsystemd-8eab766804ef4fa21d26c00fd0baab3f1a47bb5c.tar.gz
systemd-8eab766804ef4fa21d26c00fd0baab3f1a47bb5c.tar.bz2
systemd-8eab766804ef4fa21d26c00fd0baab3f1a47bb5c.zip
core: support %j in unit dependency resolution
Commit 250e9fadbcc0ca90e697d7efb40855b054ed3b8f introduced support for %j/%J specifier in unit files. The function unit_name_printf is used in unit dependency resolution, such as Wants / After directives, but was missing support for the %j. Add to allow directives such as: [Unit] Wants=bar-%j.target Fixes: systemd/systemd#11217 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'src')
-rw-r--r--src/core/unit-printf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c
index a8e84ebe8..72391ace3 100644
--- a/src/core/unit-printf.c
+++ b/src/core/unit-printf.c
@@ -195,6 +195,7 @@ int unit_name_printf(Unit *u, const char* format, char **ret) {
{ 'N', specifier_prefix_and_instance, NULL },
{ 'p', specifier_prefix, NULL },
{ 'i', specifier_string, u->instance },
+ { 'j', specifier_last_component, NULL },
{ 'g', specifier_group_name, NULL },
{ 'G', specifier_group_id, NULL },