<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16130</bug_id>
          
          <creation_ts>2026-01-13 03:29:36 +0000</creation_ts>
          <short_desc>systemd template units with instance names containing either &apos;.&apos; or a &apos;\x&apos; escape will not work</short_desc>
          <delta_ts>2026-04-23 15:22:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>5.0.19</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.0.17</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Trent Piepho">trent.piepho</reporter>
          <assigned_to name="Trent Piepho">trent.piepho</assigned_to>
          <cc>ccasciato</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>paul</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yoann.congal</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>103824</commentid>
    <comment_count>0</comment_count>
    <who name="Trent Piepho">trent.piepho</who>
    <bug_when>2026-01-13 03:29:36 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103825</commentid>
    <comment_count>1</comment_count>
      <attachid>5170</attachid>
    <who name="Trent Piepho">trent.piepho</who>
    <bug_when>2026-01-13 03:41:34 +0000</bug_when>
    <thetext>Created attachment 5170
Proposed fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103914</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-01-15 15:37:16 +0000</bug_when>
    <thetext>Hi Trent,
Can you send the patch to the oe-core list?
FYI:
https://docs.yoctoproject.org/contributor-guide/index.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103918</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2026-01-15 15:39:58 +0000</bug_when>
    <thetext>Note that this won&apos;t be required for master/whinlatter/walnascar, as they have removed the replacement script from systemd-systemctl-native (oe-core 7a580800db (&quot;systemd: Build the systemctl executable&quot;))

Also, a related patch would be &quot;systemd.bbclass: support template files with dots&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104405</commentid>
    <comment_count>4</comment_count>
    <who name="Paul Barker">paul</who>
    <bug_when>2026-02-26 15:06:50 +0000</bug_when>
    <thetext>Hi Trent,

Please re-submit the patch against the appropriate branch (scarthgap and/or kirkstone). As Ross says, this isn&apos;t required on walnascar or later and as Antonin says, the patch doesn&apos;t apply to the master branch [1].

[1]: https://lore.kernel.org/openembedded-core/DFT9J4U0CL9Z.1B3K1AOQP1914@bootlin.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104614</commentid>
    <comment_count>5</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2026-03-12 15:21:29 +0000</bug_when>
    <thetext>Patch sent to ML but not tagged for scarthgap:
https://lore.kernel.org/openembedded-core/20260120011745.2474832-1-trent.piepho@igorinstitute.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104743</commentid>
    <comment_count>6</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2026-03-19 15:15:42 +0000</bug_when>
    <thetext>Patch currently in review</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105235</commentid>
    <comment_count>7</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2026-04-23 15:22:01 +0000</bug_when>
    <thetext>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&amp;id=0514c317523330f75937123c45bb0528e4830f61</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5170</attachid>
            <date>2026-01-13 03:41:34 +0000</date>
            <delta_ts>2026-01-13 03:41:34 +0000</delta_ts>
            <desc>Proposed fix</desc>
            <filename>0001-systemd-systemctl-Fix-instance-name-parsing-with-esc.patch</filename>
            <type>text/plain</type>
            <size>2758</size>
            <attacher name="Trent Piepho">trent.piepho</attacher>
            
              <data encoding="base64">RnJvbSA0YjZiMDY4ZDY2NzJkODQ1NmZlODA1ZmYwOTFjNmFjZGY5YjgwNDc3IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBUcmVudCBQaWVwaG8gPHRwaWVwaG9AZ21haWwuY29tPgpEYXRl
OiBNb24sIDEyIEphbiAyMDI2IDE5OjI4OjU5IC0wODAwClN1YmplY3Q6IFtQQVRDSF0gc3lzdGVt
ZC1zeXN0ZW1jdGw6I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C4i
LCAiQC4iLCBzZWxmLnVuaXQsIDEpCisgICAgICAgICAgICB1bml0ID0gcmUuc3ViKHIiQHt9XC4i
LmZvcm1hdChyZS5lc2NhcGUoaW5zdGFuY2UpKSwgIkAuIiwgc2VsZi51bml0LCAxKQogICAgICAg
ICBlbHNlOgogICAgICAgICAgICAgaW5zdGFuY2UgPSBOb25lCiAgICAgICAgICAgICB1bml0ID0g
c2VsZi51bml0Ci0tIAoyLjQ3LjAKCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>