[pve-devel] applied: [PATCH v2 container] fix issue where ttys aren't correctly set after restore

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Sep 17 09:19:19 CEST 2019


applied

On Fri, Sep 13, 2019 at 12:35:57PM +0200, Oguz Bektas wrote:
> restore from unpriv to priv causes a problem with the log-in from web
> console, since the /etc/securetty file isn't modified after a restore to
> reflect that change (/dev/lxc/tty1 and so on).
> 
> template_fixup is normally called in post_create_hook, but we have no
> $password or $ssh_keys to call the hook with during the restore. instead
> we call template_fixup by itself to fix the ttys on some distributions.
> 
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
>  src/PVE/API2/LXC.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
> index 6ddff9c..dab959f 100644
> --- a/src/PVE/API2/LXC.pm
> +++ b/src/PVE/API2/LXC.pm
> @@ -415,6 +415,8 @@ __PACKAGE__->register_method({
>  
>  		    if ($restore) {
>  			PVE::LXC::Create::restore_configuration($vmid, $rootdir, $conf, !$is_root, $unique, $skip_fw_config_restore);
> +			my $lxc_setup = PVE::LXC::Setup->new($conf, $rootdir);
> +			$lxc_setup->template_fixup($conf);
>  		    } else {
>  			my $lxc_setup = PVE::LXC::Setup->new($conf, $rootdir); # detect OS
>  			PVE::LXC::Config->write_config($vmid, $conf); # safe config (after OS detection)
> -- 
> 2.20.1




More information about the pve-devel mailing list