]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
make mountcgroups hook to lxc.include aware (v2)
authorS.Çağlar Onur <caglar@10ur.org>
Sun, 15 Dec 2013 05:06:30 +0000 (00:06 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 16 Dec 2013 14:44:32 +0000 (08:44 -0600)
[resending the patch from correct branch]

commit 09ad624693cb0ef41cf246e2876b5f356783b34d introduced lxc.include option
to include other config files. This patch uses it in mountcgroups hook otherwise
lxc-start fails with following error message for the nested containers;

root@oOo:/var/lib/lxc/raring# lxc-start -l debug -o l -n raring -d
lxc-start: command get_cgroup failed to receive response

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
hooks/mountcgroups

index a63c8db827da343de28c2d9147850cb6046e0463..073929c607c0041e0d4c8113d4f68c067809cab2 100755 (executable)
@@ -43,7 +43,9 @@ do_devices_setup() {
     local line
     local w  # which (allow or deny)
     local v  # value
-    egrep "^lxc.cgroup.devices.(allow|deny)[ \t]*=" ${configfile} | while read line; do
+    # lxc.include provides common configuration options
+    local commonconfigfile=$(egrep "^lxc.include[ \t]*=" ${configfile} | awk -F= '{ print $2 }')
+    cat ${configfile} ${commonconfigfile} | egrep "^lxc.cgroup.devices.(allow|deny)[ \t]*=" | while read line; do
         w=`echo $line | awk -F. '{ print $4 }' | awk '{ print $1 }'`
         v=`echo $line | awk -F= '{ print $2 }'`
         echo "$v" >> "$devdir"/devices.$w