Dennboy Posted September 6, 2021 Posted September 6, 2021 Dear all, I'm running Armbian 21.02.1 on the nanopi neo3 (diagnostic: http://ix.io/3y5D) using /etc/network/interfaces and have network-manager disabled (`sudo systemctl disable network-manager.service` ). I occasionally use network-manager for a usb-wifi stick. When I recently upgraded the packages it triggered a network-manager update. After a reboot the nanopi was not able to start is networking, it only got a 169.254.6.233 address. After analyzing the situation the network-manager update apparently removed the softlink `/etc/resolv.conf -> /run/resolvconf/resolv.conf` and replaced it with a text file. Can network-manager be changed somehow, so that it keeps using the softlink instead of its own interpretation of /etc/resolv.conf? Kind regards, Dennis
lanefu Posted September 6, 2021 Posted September 6, 2021 I'll give better answer later but yeah there's an option you can set in network manager.conf that lets you set resolver=files
Dennboy Posted September 6, 2021 Author Posted September 6, 2021 Hi Ianefu, Thanks for the pointer. It appears that rc-manager in `/etc/NetworkManager/NetworkManager.conf` is currently set to file, it probably needs to be set to something else to respect the softlink in /etc/resolv.conf. From the networkmanager.conf manpage : rc-manager Set the resolv.conf management mode. The default value depends on NetworkManager build options, and this version of NetworkManager was build with a default of "resolvconf". Regardless of this setting, NetworkManager will always write resolv.conf to its runtime state directory /run/NetworkManager/resolv.conf. From the description of the different options, it looks like it can be set to `symlink` or `resolvconf` to improve its behaviour, even `file` should not replace existing links... unless there is something in the network-manager debian package that does this... Kind regards, Dennis
tparys Posted September 7, 2021 Posted September 7, 2021 If you know you're only using ifupdown, and never NetworkManager, you can always just disable it? sudo systemctl stop NetworkManager sudo systemctl disable NetworkManager
Dennboy Posted September 8, 2021 Author Posted September 8, 2021 Hi tparys, Yes, that is exactly my point. I had NetworkManager stopped and disabled, and during an apt update && apt upgrade, the linked /etc/resolv.conf was turned into a NetworkManager managed textfile, rendering 2 nanopi neo3's unreachable after reboot. I had to use debug-uart to repair the softlink. Kind regards, Dennis
tparys Posted September 10, 2021 Posted September 10, 2021 Interesting. Doing some more digging into the debian postinst scripts. May be useful for you in the future if this becomes a continuing issue. The resolvconf package touches this file after installation (/var/lib/dpkg/info/resolvconf.postinst), but only once (tracked via a file you can pre-place, and disable any action on its part). # Linkify /etc/resolv.conf if appropriate if [ ! -e /var/lib/resolvconf/linkified ] ; then ... <snip> ... ln -nsf ../run/resolvconf/resolv.conf /etc/resolv.conf # Make a record that we have created it :> /var/lib/resolvconf/linkified fi Looks like network-manager does too (/var/lib/dpkg/info/network-manager.postinst), but only if it's already a link. SystemD appears to poke this file on a fresh installation (/var/lib/dpkg/info/systemd.postinst), but not on upgrade. Might be useful to find out what /etc/resolv.conf is pointing to, and look for that pattern in /var/lib/dpkg/info? Might tell you which package is tripped you up, and how to prevent it from doing that in the future? 1
Recommended Posts