]> git.proxmox.com Git - pve-container.git/commitdiff
use common/userns.conf if no ostype-speicifc one exists
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 12 Feb 2016 08:27:33 +0000 (09:27 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 16 Feb 2016 11:14:20 +0000 (12:14 +0100)
(LXC doesn't ship an alpine.conf)

src/PVE/LXC.pm

index 52cdb68828041760b5b3ad0218513410abea5498..42f6cc3ba7a7d2d055b5180ac4fea51259a92189 100644 (file)
@@ -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)";