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. - "/run/systemd/resolve/resolv.conf" - "/lib/systemd/resolv.conf" - "/usr/lib/systemd/resolv.conf" 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 <https://git.io/v5L4d> 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 <https://git.io/v5L4S> /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.
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)
(In reply to comment #0) > 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 <https://git.io/v5L4S> /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. I wonder why ${sysconfdir}/resolv-conf.systemd is created when resolved is not enabled? Maxin, any ideas on this one?
I have workarounded this by creating a NM config-file that changes the default DNS update method from "symlink" to "file". * With the "symlink" 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 "file", 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 "file" this config-file can be used: #/etc/NetworkManager/NetworkManager.conf [main] rc-manager=file
Reassigning Jussi's bugs.
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.
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 ***