[systemd-devel] Template unit : specifier validity

Thomas HUMMEL thomas.hummel at pasteur.fr
Thu Jan 16 18:29:28 UTC 2025


On 1/16/25 4:29 PM, Lennart Poettering wrote:
> On Do, 16.01.25 11:31, Thomas HUMMEL (thomas.hummel at pasteur.fr) wrote:
> 
>> Hello,
>>
>> Is the %i (or %I) specifier supposed to be valid for a template service unit
>> for the Require= and After= directives ?
>> It does not seem so in my tests
>>
>> Documentation states:
>> "you may use the special "%i" specifier in many of the configuration
>> options" but don't seem to detail which one exactly.
>>
>> It also states:
>> "The following specifiers are interpreted in the Install section: %a, %b,
>> %B, %g, %G, %H, %i, %j, %l, %m, %n, %N, %o, %p, %u, %U, %v, %w, %W, %%"
>>
>> But I think some are valid in (some) directives of the [Unit] or [Service]
>> section.
>>
>> My use case would be to express a dynamic activation and order dependency on
>> a device name known only at boot time.
> 
> Please provide a minimal example of a unit file you think should work
> but doesn't.

Hello thanks for your answer.

It actually works as expected (I had a doubt it was legit for those 
specific options because I could not find this exact info in the doc).

I thought in my case it did not work because journald showed a 
dependency error but, with systemd on debug mode I could see it was an 
actual dependency failure and not a specifier expand issue (basically I 
instanciated the service with an incorrect parameter).

Sorry for the noise and thanks again for your help

-- 
Thomas HUMMEL
HPC Group
Institut PASTEUR
Paris, FRANCE


More information about the systemd-devel mailing list