<?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>15768</bug_id>
          
          <creation_ts>2025-02-20 21:44:24 +0000</creation_ts>
          <short_desc>systemd recipe edits wrong tmpfile.d file for resolv.conf</short_desc>
          <delta_ts>2025-04-18 02:22:28 +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.7</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</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.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Trent Piepho">trent.piepho</reporter>
          <assigned_to name="Trent Piepho">trent.piepho</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>mingli.yu</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101193</commentid>
    <comment_count>0</comment_count>
    <who name="Trent Piepho">trent.piepho</who>
    <bug_when>2025-02-20 21:44:24 +0000</bug_when>
    <thetext>The systemd recipe will use sed to try to edit the tmpfiles.d created symlink from /etc/resolv.conf when using systemd-resolved.  However, it tries to edit ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf

This is the wrong fine since systemd 250.  It should now be systemd-resolve.conf</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101240</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-02-27 15:34:50 +0000</bug_when>
    <thetext>Another interesting suggestion. 
Can you send a patch to the list?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101548</commentid>
    <comment_count>2</comment_count>
    <who name="Trent Piepho">trent.piepho</who>
    <bug_when>2025-04-03 01:41:15 +0000</bug_when>
    <thetext>It&apos;s more complex to fix this than it might appear at first.

If one changes the conf file to edit to be the correct one, then it creates a new problem.

The alternatives system is also used to make /etc/resolv.conf a symlink to /etc/resolv-conf.systemd, or elsewhere, depending on the alternative chosen for it.

If the tmpfiles.d conf file is fixed, then tmpfiles will make a direct link from:
/etc/resolv.conf -&gt; ../run/systemd/resolve/stub-resolv.conf

But at the same time, alternatives is configured to manage the same symlink as:
/etc/resolv.conf -&gt; /etc/resolv-conf.systemd

So they end up fighting each other.  Updating systemd via opkg will try to change the link.

But that&apos;s not even all of it.

If volatile-binds is included, it will use a symlink from /etc/tmpfiles.d/etc.conf to /dev/null to disable to processing of the etc.conf file in /usr/lib/tmpfiles.d.  The idea being that files in /etc will be a in a read-only rootfs and tmpfiles.d will fail to make them.

As pointed out in the initial bug result, since systemd 250 this link is not in the etc.conf file anymore and so is no longer masked by volatile-binds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101556</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-04-03 16:05:09 +0000</bug_when>
    <thetext>Adding my co-worker Mingli who may be able to help &apos;resolv(.conf)&quot; this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101557</commentid>
    <comment_count>4</comment_count>
    <who name="Trent Piepho">trent.piepho</who>
    <bug_when>2025-04-03 17:53:30 +0000</bug_when>
    <thetext>I have tested that the system one gets now works with Network Manager.  This matters, because NetworkManager uses the link target of /etc/resolv.conf to determine the resolve configuration.  It doesn&apos;t just lstat(&quot;/etc/resolv.conf&quot;), but instead follows all the links and if the final file is &quot;/run/systemd/resolve/…&quot; then it detects systemd-resolved mode.

And in case it&apos;s not clear, what one gets now is a two link chain:

/etc/resolv.conf -&gt; /etc/resolv-conf.systemd
/etc/resolv-conf.systemd -&gt; ../run/systemd/resolve/{stub-,}resolv.conf

The former link from alternatives and the latter link from the systemd install recipe case for systemd-resolved configuration.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101618</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-04-10 15:04:18 +0000</bug_when>
    <thetext>Apprently works. I not aware of tha commit that changed things...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101639</commentid>
    <comment_count>6</comment_count>
    <who name="Trent Piepho">trent.piepho</who>
    <bug_when>2025-04-12 20:20:29 +0000</bug_when>
    <thetext>It&apos;s in this commit, https://github.com/systemd/systemd/commit/b15f6eae421ad64773c0be934fd372d1ca230adb

It&apos;s clear it the file the link is in is changing, and the yocto recipe was never updated to edit this file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101683</commentid>
    <comment_count>7</comment_count>
    <who name="Mingli Yu">mingli.yu</who>
    <bug_when>2025-04-18 02:22:28 +0000</bug_when>
    <thetext>Fixed by https://git.openembedded.org/openembedded-core/commit/?id=a3020c11c91304b7400bc19f80e44e7d3720281d</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>