From fa7fced87899ae37f193c81115543d1df5c28fbb Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Sun, 15 Dec 2013 00:06:30 -0500 Subject: [PATCH] make mountcgroups hook to lxc.include aware (v2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit [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 Signed-off-by: Serge Hallyn --- hooks/mountcgroups | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hooks/mountcgroups b/hooks/mountcgroups index a63c8db82..073929c60 100755 --- a/hooks/mountcgroups +++ b/hooks/mountcgroups @@ -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 -- 2.47.3