Bug 76914 - RFE: Resolve "%" specifiers for Condition*=
Summary: RFE: Resolve "%" specifiers for Condition*=
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 18:26 UTC by Graham Cobb
Modified: 2014-06-23 16:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.