bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
608 stars 64 forks source link

Broken symlink for resolv.conf #278

Open JustANormalTinker opened 1 year ago

JustANormalTinker commented 1 year ago

I hijacked an arch system and installed a ubuntu strata, everything was fine until I rebooted and then DNS was not working. After investigation I found out that /etc/resolv.conf points to /run/systemd/resolve/stub-resolv.conf, this file does not exist nor does the directory /run/systemd/resolve exist. Modifying /etc/resolvconf/update.d/00bedrock doesn't not work as after rebooting it still points to /run/systemd/resolve/stub-resolve.conf

After creating /run/systemd/resolve/stub-resolve.conf and restarting NetworkManager everything works fine.

Here is my modified /etc/resolvconfig/update.d/00bedrock

if [ -e /etc/resolv.conf ] || [ -h /etc/resolv.conf ]; then
        exit
fi

for f in /etc/resolvconf/run/resolv.conf \
                /run/resolvconf/resolv.conf \
                /run/NetworkManager/resolv.conf \
                ; do
        if [ -e "${f}" ]; then
                ln -s "${f}" /etc/resolv.conf
                exit
        fi
done
JustANormalTinker commented 1 year ago

After installing a void strata it works fine????

paradigm commented 1 year ago

I poked around but don't have any guesses for what happened here. Per the comment in the 00bedrock script you found, Bedrock deletes /etc/resolv.conf at boot so the bad resolv.conf you found was probably not inherited from another distro's init. Moreover, the script should only create the symlink if it sees the file there - since you didn't see the file, it shouldn't have done that. I have no idea how installing a new stratum (of any distro), but not booting with its init or otherwise launching its networking stack would change things here.

Happy to hear that, whatever it was, it's resolved now.