[pve-devel] applied: [PATCH pve-container] Unmount containers before trying to mount them, fixes #1721

Wolfgang Bumiller w.bumiller at proxmox.com
Fri May 4 11:13:49 CEST 2018


applied with a fixup

On Fri, May 04, 2018 at 10:04:16AM +0200, René Jochum wrote:
> Signed-off-by: René Jochum <r.jochum at proxmox.com>
> ---
>  src/lxc-pve-prestart-hook | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/lxc-pve-prestart-hook b/src/lxc-pve-prestart-hook
> index 61a8ef3..d50520f 100755
> --- a/src/lxc-pve-prestart-hook
> +++ b/src/lxc-pve-prestart-hook
> @@ -94,6 +94,9 @@ __PACKAGE__->register_method ({
>  	    push @$devices, $dev if $dev && $mountpoint->{quota};
>  	};
>  
> +	# Unmount first when the user mounted the container with "pct mount".
> +	PVE::Tools::run_command(['umount', '--recursive', $rootdir], outfunc => sub {}, errfunc => sub {});

run_command throws an exception when the command fails, I added an
eval{} around it as a fixup commit.

> +
>  	PVE::LXC::Config->foreach_mountpoint($conf, $setup_mountpoint);
>  
>  	my $lxc_setup = PVE::LXC::Setup->new($conf, $rootdir);
> -- 
> 2.11.0



More information about the pve-devel mailing list