Bug 76914

Summary: RFE: Resolve "%" specifiers for Condition*=
Product: systemd Reporter: Graham Cobb <g+syncevolution>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Graham Cobb 2014-04-01 18:26:37 UTC
[This was previously reported by someone else at https://bugzilla.novell.com/show_bug.cgi?id=758427 but they did not choose to report it upstream]

I am creating a systemd template file used to start various instances of my service.  Each instance requires its own configuration file.  I wanted to use:

ConditionPathExists=/etc/tinc/%I/tinc.conf

However, ConditionPathExists (and, I presume, the other conditions) do not use the %-specifiers.

If this is deliberate, please consider changing the decision as the conditions in a template are likely to often be dependent on the particular instance being created (the earlier bug report has an example of checking a particular tty device exists).
Comment 1 David Strauss 2014-04-06 05:49:32 UTC
ConditionPathExists= is part of the general unit configuration options. According to the "unit" man page, only the [Install] options accept "%" specifiers [1]. Additionally, for services, ExecStart= accepts them [2].

Because this seems like a reasonable thing to add, though, I've updated this issue to be an RFE.

[1] http://www.freedesktop.org/software/systemd/man/systemd.unit.html#%5BInstall%5D%20Section%20Options
[2] http://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart=
Comment 2 Lennart Poettering 2014-06-23 16:56:03 UTC
We actually do honour specifiers in conditions in recent systemd versions.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.