From d19640c5504257a87ca649754f0e213fc9c51402 Mon Sep 17 00:00:00 2001 From: seanlionelbarrett Date: Tue, 11 Feb 2025 17:08:21 +1100 Subject: [PATCH] Fix resolv.conf failing to delete due to file attributes --- setup/system.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup/system.sh b/setup/system.sh index fce3091f..ac715180 100755 --- a/setup/system.sh +++ b/setup/system.sh @@ -356,6 +356,10 @@ fi # which is where bind9 will be running. Obviously don't do this before # installing bind9 or else apt won't be able to resolve a server to # download bind9 from. +# Deleting resolv.conf fails if the file has the immutable attribute +# or the append only attribute. So we ensure those attributes are not set +# before attempting to delete the file. +chattr -a -i /etc/resolv.conf rm -f /etc/resolv.conf tools/editconf.py /etc/systemd/resolved.conf DNSStubListener=no echo "nameserver 127.0.0.1" > /etc/resolv.conf