public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Stoiko Ivanov <s.ivanov@proxmox.com>
Subject: [pve-devel] applied: [PATCH container] setup: template_fixup: remove bogus LXC_NAME line from /etc/hosts
Date: Tue, 13 Jun 2023 17:25:48 +0200	[thread overview]
Message-ID: <39063f6b-c6a0-9ff3-5472-2d8f91635a64@proxmox.com> (raw)
In-Reply-To: <20230609173627.3252569-1-s.ivanov@proxmox.com>

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@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.




  parent reply	other threads:[~2023-06-13 15:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 17:36 [pve-devel] " Stoiko Ivanov
2023-06-13 15:02 ` Stoiko Ivanov
2023-06-13 15:25 ` Thomas Lamprecht [this message]
2023-06-13 16:46 ` Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39063f6b-c6a0-9ff3-5472-2d8f91635a64@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=s.ivanov@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal