[pve-devel] [PULL container 4/5] use common/userns.conf if no ostype-speicifc one exists

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Feb 12 09:27:33 CET 2016


(LXC doesn't ship an alpine.conf)
---
 src/PVE/LXC.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index bdda866..80d4016 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1083,9 +1083,13 @@ sub update_lxc_config {
 
     my $ostype = $conf->{ostype} || die "missing 'ostype' - internal error";
     if ($ostype =~ /^(?:debian | ubuntu | centos | fedora | opensuse | archlinux | alpine)$/x) {
-	$raw .= "lxc.include = /usr/share/lxc/config/$ostype.common.conf\n";
+	my $inc ="/usr/share/lxc/config/$ostype.common.conf";
+	$inc ="/usr/share/lxc/config/common.conf" if !-f $inc;
+	$raw .= "lxc.include = $inc\n";
 	if ($unprivileged || $custom_idmap) {
-	    $raw .= "lxc.include = /usr/share/lxc/config/$ostype.userns.conf\n"
+	    $inc = "/usr/share/lxc/config/$ostype.userns.conf";
+	    $inc = "/usr/share/lxc/config/userns.conf" if !-f $inc;
+	    $raw .= "lxc.include = $inc\n"
 	}
     } else {
 	die "implement me (ostype $ostype)";
-- 
2.1.4





More information about the pve-devel mailing list