<?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>15499</bug_id>
          
          <creation_ts>2024-05-31 07:39:47 +0000</creation_ts>
          <short_desc>SystemD unit file that is UTF-8 encoded causes uncaught exception in SYSTEMD_SERVICE postinst</short_desc>
          <delta_ts>2024-07-25 15:09:44 +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>oe-core other</component>
          <version>4.0.16</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.0.20</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>martin.scheffler</reporter>
          <assigned_to>martin.scheffler</assigned_to>
          <cc>JPEWhacker</cc>
    
    <cc>randy.macleod</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>99107</commentid>
    <comment_count>0</comment_count>
    <who name="">martin.scheffler</who>
    <bug_when>2024-05-31 07:39:47 +0000</bug_when>
    <thetext>I have a UTF-8 encoded SystemD unit file that I want to autostart with 

SYSTEMD_SERVICE:${PN} = &quot;my.service&quot;

This causes the following exception:

Traceback (most recent call last):
  File &quot;/build/lmp/build-lmp/tmp-lmp/work/intel_corei7_64-lmp-linux/lmp-factory-image/1.0-r0/recipe-sysroot-native/usr/bin/systemctl&quot;, line 351, in &lt;module&gt;
    main()
  File &quot;/build/lmp/build-lmp/tmp-lmp/work/intel_corei7_64-lmp-linux/lmp-factory-image/1.0-r0/recipe-sysroot-native/usr/bin/systemctl&quot;, line 337, in main
    SystemdUnit(root, service).enable()
  File &quot;/build/lmp/build-lmp/tmp-lmp/work/intel_corei7_64-lmp-linux/lmp-factory-image/1.0-r0/recipe-sysroot-native/usr/bin/systemctl&quot;, line 222, in enable
    config = SystemdFile(self.root, path, instance_unit_name)
  File &quot;/build/lmp/build-lmp/tmp-lmp/work/intel_corei7_64-lmp-linux/lmp-factory-image/1.0-r0/recipe-sysroot-native/usr/bin/systemctl&quot;, line 31, in __init__
    self._parse(root, path)
  File &quot;/build/lmp/build-lmp/tmp-lmp/work/intel_corei7_64-lmp-linux/lmp-factory-image/1.0-r0/recipe-sysroot-native/usr/bin/systemctl&quot;, line 80, in _parse
    k = m.group(&apos;key&apos;)
AttributeError: &apos;NoneType&apos; object has no attribute &apos;group&apos;

I hacked the systemctl python script to print out the path of the unit file and the currently examined line, and the exception occurs right at the first line containing &quot;[Unit]&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99133</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Watt">JPEWhacker</who>
    <bug_when>2024-06-06 14:33:42 +0000</bug_when>
    <thetext>Can you attach the unit file that causes the problem please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99450</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-07-25 15:09:44 +0000</bug_when>
    <thetext>Please re-open if you are able to provide the requested information.
We can&apos;t reproduce the issue easily if at all.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>