Fix removal of resolv.conf

This commit is contained in:
Jip-Hop 2024-06-23 11:27:48 +02:00
parent f94ff51a51
commit f87e372dae
1 changed files with 2 additions and 1 deletions

View File

@ -1379,9 +1379,10 @@ def create_jail(**kwargs):
config.my_set("startup", 0) config.my_set("startup", 0)
start_now = False start_now = False
# Remove config which systemd handles for us
with contextlib.suppress(FileNotFoundError): with contextlib.suppress(FileNotFoundError):
# Remove config which systemd handles for us
os.remove(os.path.join(jail_rootfs_path, "etc/machine-id")) os.remove(os.path.join(jail_rootfs_path, "etc/machine-id"))
with contextlib.suppress(FileNotFoundError):
os.remove(os.path.join(jail_rootfs_path, "etc/resolv.conf")) os.remove(os.path.join(jail_rootfs_path, "etc/resolv.conf"))
# https://github.com/systemd/systemd/issues/852 # https://github.com/systemd/systemd/issues/852