public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: Fiona Ebner <f.ebner@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH container] setup: nixos: set cmode to console by default
Date: Wed, 14 Feb 2024 14:04:45 +0100	[thread overview]
Message-ID: <fadux6yuioyds7wtvn47en5dfkfu5pyrhknpvuxqtwdy46yvop@j2vvahvyhomf> (raw)
In-Reply-To: <97b2b802-5e4b-42cc-9623-72fafb7b9495@proxmox.com>

Thanks for the review!

On Fri, Jan 26, 2024 at 03:47:34PM +0100, Fiona Ebner wrote:
> Am 21.11.23 um 10:40 schrieb Christoph Heiss:
[..]
> > diff --git a/src/PVE/LXC/Setup/NixOS.pm b/src/PVE/LXC/Setup/NixOS.pm
> > index c702f3d..7f23111 100644
> > --- a/src/PVE/LXC/Setup/NixOS.pm
> > +++ b/src/PVE/LXC/Setup/NixOS.pm
> > @@ -17,6 +17,11 @@ sub new {
> >
> >      $conf->{ostype} = "nixos";
> >
> > +    # Set `cmode` to `console` for NixOS containers, as getty is only configured for /dev/console by
> > +    # default, but not any TTY ports. This way, users still get a login/shell instead of just a
> > +    # blank screen when openinng the console in the web UI.
> > +    $conf->{cmode} = 'console';
> > +
> >      return bless $self, $class;
> >  }
> >
>
> Won't this override any pre-existing setting (from user or backup)?
> Even if checking for that, it could still be considered a breaking
> change, i.e. other people might have configured their NixOS container
> differently, so maybe best to wait for the next major release?

Yep, just tried that out - so that's definitely a no-go.

>
> For now, we could log a warning if no explicit 'cmode' was specified for
> NixOS.
>
> I don't see any other implementation of new() overriding any defaults.
> Should we even start doing that?

Well, looking at the code again, there is the ->template_fixup() sub,
which gets called on restores after ->new(). This does seem to override
some things (e.g. ->setup_securetty()) for most of the distros.

So I guess this would be correct place after all for this, if we
override something.

Anyway, so just a

  warn "..." if `$conf->{cmode} ne 'console'`;

if ->new() would be acceptable?





  reply	other threads:[~2024-02-14 13:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21  9:40 Christoph Heiss
2024-01-26 14:47 ` Fiona Ebner
2024-02-14 13:04   ` Christoph Heiss [this message]
2024-02-14 14:03     ` Fiona Ebner

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=fadux6yuioyds7wtvn47en5dfkfu5pyrhknpvuxqtwdy46yvop@j2vvahvyhomf \
    --to=c.heiss@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.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