[pve-devel] applied: [PATCH container] setup: template_fixup: remove bogus LXC_NAME line from /etc/hosts

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jun 13 17:25:48 CEST 2023


Am 09/06/2023 um 19:36 schrieb Stoiko Ivanov:
> 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 at proxmox.com>
> ---
>  src/PVE/LXC/Setup/Alpine.pm    |  2 ++
>  src/PVE/LXC/Setup/ArchLinux.pm |  2 ++
>  src/PVE/LXC/Setup/Base.pm      | 11 +++++++++++
>  src/PVE/LXC/Setup/CentOS.pm    |  2 ++
>  src/PVE/LXC/Setup/Fedora.pm    |  2 ++
>  src/PVE/LXC/Setup/Gentoo.pm    |  2 ++
>  src/PVE/LXC/Setup/SUSE.pm      |  2 ++
>  7 files changed, 23 insertions(+)
> 
>

applied, with bug ID amended, thanks!

FWIW, I'd think that having a more flexible regex to drop any IP + LXC_NET would
be fine too, as would be doing this more centrally for any template (not all Debian
templates users use are guaranteed to come from us), e.g., as separate call inside
the PVE::LXC::Setup->template_fix-up's protected_call closure, but just throwing out
for future reference, i.e., if we need to extend this or add to more distros.





More information about the pve-devel mailing list