<?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>11969</bug_id>
          
          <creation_ts>2017-08-23 18:04:01 +0000</creation_ts>
          <short_desc>issues with network-manager handling of resolv.conf when systemd-resolved is not enabled</short_desc>
          <delta_ts>2018-12-25 03:12:50 +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>connectivity</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>11331</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.7 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Alberto Lopez Perez">clopez</reporter>
          <assigned_to name="Kai Kang">kai.kang</assigned_to>
          <cc>bst</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>maxin.john</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>stephano</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>76093</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2017-08-23 18:04:01 +0000</bug_when>
    <thetext>network-manager tries to auto-detect if systemd-resolved is enabled. When it detects that it skips updating the resolv.conf file.

Therefore if a false positive is triggered, this means DNS resolution will be broken on the system.

To do this detection it simply checks if the file /etc/resolv.conf points to any of this symlinks.

 - &quot;/run/systemd/resolve/resolv.conf&quot;
 - &quot;/lib/systemd/resolv.conf&quot;
 - &quot;/usr/lib/systemd/resolv.conf&quot;

So far so fine.

But then the issue is that the oe-core recipe is linking /etc/resolv.conf to /run/systemd/resolve/resolv.conf even when systemd-resolved is not enabled.
The reason for this is to allow updating resolv.conf on read-only-rootfs images. See oe-core commit 7f087f161e8942bcd35f88999dfca418f01cd7fa &lt;https://git.io/v5L4d&gt;

So the fix could be to symlink /etc/resolv.conf to a different path in /run when systemd-resolved is not enabled, right?

The issue is that after commit 00f1cc1a85ee736773442cd82f3225ff9f731e8c in meta-openembedded &lt;https://git.io/v5L4S&gt; /etc/resolv.conf always points to /etc/resolv-conf.systemd and at the same time the path /etc/resolv-conf.systemd is also checked by network-manager as one of the targets to detect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76095</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2017-08-23 18:11:10 +0000</bug_when>
    <thetext>Option I see going forward:

Option A) Make NM follow symlinks (readlink -f) and use a different target path for the resolv.conf file at /run than the one used when resolved is enabled.

Option B) Use a different ALTERNATIVE_TARGET for the resolv-conf alternative link at /etc/resolv.conf (and at the same time try to use a different destination name in /run/resolv.conf just in case NM someday decides to follow symlinks readlink -f)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76118</commentid>
    <comment_count>2</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-08-24 12:04:28 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; So the fix could be to symlink /etc/resolv.conf to a different path in /run
&gt; when systemd-resolved is not enabled, right?
&gt; 
&gt; The issue is that after commit 00f1cc1a85ee736773442cd82f3225ff9f731e8c in
&gt; meta-openembedded &lt;https://git.io/v5L4S&gt; /etc/resolv.conf always points to
&gt; /etc/resolv-conf.systemd and at the same time the path
&gt; /etc/resolv-conf.systemd is also checked by network-manager as one of the
&gt; targets to detect.

I wonder why ${sysconfdir}/resolv-conf.systemd is created when resolved is not enabled?

Maxin, any ideas on this one?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76572</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2017-09-06 11:30:07 +0000</bug_when>
    <thetext>I have workarounded this by creating a NM config-file that changes the default DNS update method from &quot;symlink&quot; to &quot;file&quot;.

* With the &quot;symlink&quot; method (the default), nm updates only /run/NetworkManager/resolv.conf and then updates the /etc/resolv.conf link under certain conditions (like resolv.conf not pointing to a systemd-resolved file)

* With update method &quot;file&quot;, the content of /etc/resolv.conf is always updated (following any symlink) with the contents of the upstream DHCP DNS entries.


To set update method &quot;file&quot; this config-file can be used:


#/etc/NetworkManager/NetworkManager.conf
[main]
rc-manager=file</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76720</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-09-11 16:18:12 +0000</bug_when>
    <thetext>Reassigning Jussi&apos;s bugs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82353</commentid>
    <comment_count>5</comment_count>
    <who name="Bastian Krause">bst</who>
    <bug_when>2018-11-29 15:22:52 +0000</bug_when>
    <thetext>This is still an issue. Using NetworkManager with the default config does not work. Setting..

dns=default
rc-manager=file

..works, but this is not the desired solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82599</commentid>
    <comment_count>6</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2018-12-25 03:12:50 +0000</bug_when>
    <thetext>Fixed by commits
http://git.openembedded.org/openembedded-core/commit/?id=d9b6d538e3d81ab0d5e7b7b6adecef555d782217
http://git.openembedded.org/openembedded-core/commit/?id=732e1f74bb9f5ecc98b29197f6bcab117710adab

*** This bug has been marked as a duplicate of bug 11331 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>