]> git.proxmox.com Git - pve-container.git/commitdiff
fix #1721: unmount containers before trying to mount them
authorRené Jochum <r.jochum@proxmox.com>
Fri, 4 May 2018 08:04:16 +0000 (10:04 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 4 May 2018 09:08:36 +0000 (11:08 +0200)
Signed-off-by: René Jochum <r.jochum@proxmox.com>
src/lxc-pve-prestart-hook

index 61a8ef33c48c11e7088c60d41f780dc96af6257b..d50520ff652c6dd4f18c3a5db88403c89fede2b5 100755 (executable)
@@ -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 {});
+
        PVE::LXC::Config->foreach_mountpoint($conf, $setup_mountpoint);
 
        my $lxc_setup = PVE::LXC::Setup->new($conf, $rootdir);