<div dir="ltr"><div>Hi,</div><div>systemd itself already uses them in those sections without problems so they should definitely work:</div><br><span style="font-family:monospace">systemd-zram-setup@.service:After=dev-%i.device<br>systemd-journald@.service:Requires=systemd-journald@%i.socket systemd-journald-varlink@%i.socket<br>systemd-journald@.service:After=systemd-journald@%i.socket systemd-journald-varlink@%i.socket<br>serial-getty@.service:After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target<br>systemd-journald-sync@.service:Requires=systemd-journald@%i.socket systemd-journald-varlink@%i.socket<br>systemd-journald-sync@.service:After=systemd-journald@%i.socket systemd-journald-varlink@%i.socket<br>user@.service:After=systemd-logind.service user-runtime-dir@%i.service dbus.service systemd-oomd.service<br>systemd-fsck@.service:After=%i.device systemd-fsck-root.service local-fs-pre.target<br>quotaon@.service:After=systemd-quotacheck@%i.service %i.mount<br>systemd-pcrfs@.service:After=%i.mount tpm2.target systemd-pcrfs-root.service<br>systemd-quotacheck@.service:After=%i.mount<br></span><div><span style="font-family:monospace">systemd-growfs@.service:After=systemd-repart.service %i.mount</span></div><br><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">Maybe you did not account for some of the escaping systemd does (esp. slashes)? It could also be that you are using a very old systemd version though I think this has been possible for ages if not forever.</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">Cheers, Nils<br></div><br></div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Jan 16, 2025 at 1:30 PM Thomas HUMMEL <<a href="mailto:thomas.hummel@pasteur.fr">thomas.hummel@pasteur.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
Is the %i (or %I) specifier supposed to be valid for a template service <br>
unit for the Require= and After= directives ?<br>
It does not seem so in my tests<br>
<br>
Documentation states:<br>
"you may use the special "%i" specifier in many of the configuration <br>
options" but don't seem to detail which one exactly.<br>
<br>
It also states:<br>
"The following specifiers are interpreted in the Install section: %a, <br>
%b, %B, %g, %G, %H, %i, %j, %l, %m, %n, %N, %o, %p, %u, %U, %v, %w, %W, %%"<br>
<br>
But I think some are valid in (some) directives of the [Unit] or <br>
[Service] section.<br>
<br>
My use case would be to express a dynamic activation and order <br>
dependency on a device name known only at boot time.<br>
<br>
<br>
Thanks for your help<br>
<br>
-- <br>
Thomas HUMMEL<br>
HPC Group<br>
Institut PASTEUR<br>
Paris, FRANCE<br>
<br>
</blockquote></div>