]> git.proxmox.com Git - pve-container.git/commit
fix #4515: template setup: remove bogus LXC_NAME line from /etc/hosts
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 9 Jun 2023 17:36:27 +0000 (19:36 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 13 Jun 2023 15:19:16 +0000 (17:19 +0200)
commit8f56203b3e6691bf597471261b9a808435b8b0bd
tree412293b230f8ae5ade88c1907fe91e3f13149032
parent5614a02f2ed0bc024f9dfe68f0615a9513490da0
fix #4515: template setup: remove bogus LXC_NAME line from /etc/hosts

Templates not built directly by us, but redistributed from
images.linuxcontainer.org contain the following line in /etc/hosts:
`127.0.1.1       LXC_NAME`

While it is mostly cosmetic - LXC_NAME, contains an underscore and is
not a valid DNS name.

Simply drop it for newly created containers in template_fixup.

We ship Debian, Devuan ourselves, without this line - so no need for
modification there.

Currently the NixOS container-template (see [0]) also does not seem
to contain the line.

Noticed the issue with a fresh fedora container, where systemd-resolved
logs a warning upon boot.

[0] https://nixos.wiki/wiki/Proxmox_Linux_Container

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/PVE/LXC/Setup/Alpine.pm
src/PVE/LXC/Setup/ArchLinux.pm
src/PVE/LXC/Setup/Base.pm
src/PVE/LXC/Setup/CentOS.pm
src/PVE/LXC/Setup/Fedora.pm
src/PVE/LXC/Setup/Gentoo.pm
src/PVE/LXC/Setup/SUSE.pm