[CRIU] [PATCH 2/2] zdtm/cgroup02: remove subgroups in the cleanup hook

Andrew Vagin avagin at openvz.org
Sat Jun 6 13:44:41 PDT 2015


systemd executes tests in subgroups:
 9679 ?        Ssl    0:41 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war -
[root at jenkins ~]# cat /proc/9679/cgroup
10:net_cls:/
9:hugetlb:/
8:cpuset:/
7:blkio:/system.slice
6:freezer:/
5:cpu,cpuacct:/system.slice
4:devices:/system.slice/jenkins.service
3:perf_event:/
2:memory:/system.slice
1:name=systemd:/system.slice/jenkins.service

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 test/zdtm/live/static/cgroup02.hook | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/zdtm/live/static/cgroup02.hook b/test/zdtm/live/static/cgroup02.hook
index 75bfb42..3dbbda1 100755
--- a/test/zdtm/live/static/cgroup02.hook
+++ b/test/zdtm/live/static/cgroup02.hook
@@ -8,7 +8,12 @@ rmroots() {
 	mount -t cgroup none $tname -o "$1"
 
 	for d in "$tname/oldroot" "$tname/newroot" "$tname/zdtmtstroot"; do
-		test -d "$d" && rmdir "$d"
+		test -d "$d" || continue
+		# sort by line length
+		for i in `find $d -type d | awk '{print length, $0}' | sort -rn | cut -d " " -f2-`; do
+			echo $i
+			rmdir $i
+		done
 	done
 
 	echo "Left there is:"
-- 
2.4.2



More information about the CRIU mailing list