[pve-devel] [PATCH pve-container] Use lxc.start.unshare and revert "unshare lxc-start ..."

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Nov 19 10:30:35 CET 2015


This reverts commit 4162edaea3452a3ffba85db95774c3615fb47cff.

This is now controlled by lxc's lxc.start.unshare
configuration option.
---
 This requires the lxc.start.unshare lxc-pve patch.
 src/PVE/API2/LXC/Status.pm | 3 +--
 src/PVE/LXC.pm             | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/API2/LXC/Status.pm b/src/PVE/API2/LXC/Status.pm
index dc05445..5e5e116 100644
--- a/src/PVE/API2/LXC/Status.pm
+++ b/src/PVE/API2/LXC/Status.pm
@@ -163,8 +163,7 @@ __PACKAGE__->register_method({
 
 		PVE::LXC::update_lxc_config($storage_cfg, $vmid, $conf);
 
-		my $cmd = ['unshare', '-m', '--',
-			   'sh', '-c', "mount --make-rslave / && exec lxc-start -n $vmid"];
+		my $cmd = ['lxc-start', '-n', $vmid];
 
 		run_command($cmd);
 
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index c61df23..b788a5a 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1069,6 +1069,8 @@ sub update_lxc_config {
 	die "implement me";
     }
 
+    $raw .= "lxc.start.unshare = 1\n";
+
     # Should we read them from /etc/subuid?
     if ($unprivileged && !$custom_idmap) {
 	$raw .= "lxc.id_map = u 0 100000 65536\n";
-- 
2.1.4




More information about the pve-devel mailing list