1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-02-26 18:17:09 +00:00

Fix resolv.conf failing to delete due to file attributes

This commit is contained in:
seanlionelbarrett 2025-02-11 17:08:21 +11:00 committed by GitHub
parent e6c354c312
commit d19640c550
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -356,6 +356,10 @@ fi
# which is where bind9 will be running. Obviously don't do this before # 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 # installing bind9 or else apt won't be able to resolve a server to
# download bind9 from. # 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 rm -f /etc/resolv.conf
tools/editconf.py /etc/systemd/resolved.conf DNSStubListener=no tools/editconf.py /etc/systemd/resolved.conf DNSStubListener=no
echo "nameserver 127.0.0.1" > /etc/resolv.conf echo "nameserver 127.0.0.1" > /etc/resolv.conf