Hello openembedded-core developers,

We are using systemd service files that use instance name to configure their 
WantedBy dependency. The names of the services could be [email protected] 
or [email protected] - the [email protected] is a template systemd service that 
reference the instance using "%i" in the [Install] section.

[Install]
WantedBy=%i.target

The expected behavior is that, when enabling [email protected], 
WantedBy=%i.target is replaced as WantedBy=multi-user.target because the 
[email protected]'s instance name is "multi-user". And the enable script 
would then create a symlink from 
/etc/systemd/system/multi-user.target.wants/[email protected] -> 
/usr/lib/systemd/system/[email protected]

However, when using openembedded-core's native systemctl script for enabling 
[email protected] during a yocto build, the %i is not replaced.

Currently, for Yocto's systemctl script to replace the "%i" with instance, the 
first character after WantedBy= must not be a "%" character. The regex used is 
in openembedded-core/meta/recipes-core/systemd/systemd-systemctl/systemctl at 
master * openembedded/openembedded-core * 
GitHub<https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-core/systemd/systemd-systemctl/systemctl#L205>
 (pasting the github mirror link because the normal git repo is inaccessible at 
my end currently).

This is faulty behavior from my perspective. 
Systemd.unit<https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#Specifiers>
 man page does not mention any restriction prohibiting "%i" as the first 
pattern after WantedBy=, and systemd's systemctl program currently allows 
WantedBy=%i.target.

Thank you,
Eric Smith
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206071): 
https://lists.openembedded.org/g/openembedded-core/message/206071
Mute This Topic: https://lists.openembedded.org/mt/109075726/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to