The systemctl replacement script that is part of systemd-systemctl-native is unable to properly parse instances that contain escapes or periods. For example, with real systemctl, these commands will work correctly to create instances of `example@.service`: ```sh systemctl enable example@host.domain.com.service systemctl enable example@two\x2dwords.service ``` The former will run the service with the unescaped instance (`%I` in the unit file) set to `host.domain.com` and the latter as `two words`. The systemctl wrapper script is unable to parse these correctly. The former will be split on the first period, rather than the last, and try to create the instance `host` of `example@.domain.com.service`. The latter will try to unescape `\x2d` in the Python script and throw an exception.
Created attachment 5170 [details] Proposed fix
Hi Trent, Can you send the patch to the oe-core list? FYI: https://docs.yoctoproject.org/contributor-guide/index.html
Note that this won't be required for master/whinlatter/walnascar, as they have removed the replacement script from systemd-systemctl-native (oe-core 7a580800db ("systemd: Build the systemctl executable")) Also, a related patch would be "systemd.bbclass: support template files with dots".
Hi Trent, Please re-submit the patch against the appropriate branch (scarthgap and/or kirkstone). As Ross says, this isn't required on walnascar or later and as Antonin says, the patch doesn't apply to the master branch [1]. [1]: https://lore.kernel.org/openembedded-core/DFT9J4U0CL9Z.1B3K1AOQP1914@bootlin.com/
Patch sent to ML but not tagged for scarthgap: https://lore.kernel.org/openembedded-core/20260120011745.2474832-1-trent.piepho@igorinstitute.com/
Patch currently in review
Fixed on scarthgap: systemd-systemctl: Fix instance name parsing with escapes or periods - openembedded-core - OpenEmbedded Core layer https://git.openembedded.org/openembedded-core/commit/?h=scarthgap&id=0514c317523330f75937123c45bb0528e4830f61