Bug 1428110

Summary: RFE: RuntimeDirectory= should resolve %i and other specifiers
Product: Red Hat Enterprise Linux 7 Reporter: Nilesh Parmar <nparmar>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Branislav Blaškovič <bblaskov>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: bblaskov, rskvaril, systemd-maint-list
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: systemd-219-33.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 09:14:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nilesh Parmar 2017-03-01 19:45:36 UTC
Description of problem:
RFE: RuntimeDirectory= should resolve %i and other specifiers

Version-Release number of selected component (if applicable):
systemd-219-30.el7_3.6

How reproducible:
Always

Steps to Reproduce:
1] Create simple systemd template unit file:

[root@dhcp5-48 ~]# cat /etc/systemd/system/demo@.service 
[Unit]
Description = demo %i
[Service]
ExecStart=/bin/sleep %i
Restart=on-failure
RuntimeDirectory=demotest%i
RuntimeDirectoryMode=755
[Install]
WantedBy=multi-user.target

[root@dhcp5-48 ~]# systemctl daemon-reload 
[root@dhcp5-48 ~]# systemctl start demo@102; systemctl status demo@102
[root@dhcp5-48 ~]# ll /run/demotest%i/

Actual results:
RuntimeDirectory currently ignores %i in instanceable service files

Expected results:
RuntimeDirectory=%i for instance would create /run/%i

Additional info: 

Github PR: https://bugs.freedesktop.org/show_bug.cgi?id=90178
           https://github.com/systemd/systemd/pull/1292

Comment 2 Lukáš Nykrýn 2017-03-02 08:41:38 UTC
https://github.com/lnykryn/systemd-rhel/pull/97

Comment 4 Lukáš Nykrýn 2017-03-20 14:14:09 UTC
fix merged to upstream staging branch ->
https://github.com/lnykryn/systemd-rhel/commit/2520d152da83096b42fe7d27cf0bf97a62b50fac
-> post

Comment 7 errata-xmlrpc 2017-08-01 09:14:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2297