summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch')
-rw-r--r--recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch b/recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch
new file mode 100644
index 00000000..162e8f9d
--- /dev/null
+++ b/recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch
@@ -0,0 +1,61 @@
1From ec85e5ca4953292c4341497704ce738669a79b64 Mon Sep 17 00:00:00 2001
2From: Serge Hallyn <serge@hallyn.com>
3Date: Fri, 2 Feb 2024 10:41:11 -0600
4Subject: [PATCH] lxc-test-usernic: drop cgroup handling
5
6This stuff is not needed in a modern systemd based system, and in fact
7breaks. It would probably be better to detect such a system so that a
8non-systemd box can still run this test. But I'm not sure what would be
9reliable.
10
11Upstream-Status: Backport from
12[https://github.com/lxc/lxc/commit/ec85e5ca4953292c4341497704ce738669a79b64]
13
14Signed-off-by: Serge Hallyn <serge@hallyn.com>
15Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
16---
17 src/tests/lxc-test-usernic.in | 28 ----------------------------
18 1 file changed, 28 deletions(-)
19
20diff --git a/src/tests/lxc-test-usernic.in b/src/tests/lxc-test-usernic.in
21index 9af8678f3..49fd5e3f7 100755
22--- a/src/tests/lxc-test-usernic.in
23+++ b/src/tests/lxc-test-usernic.in
24@@ -80,34 +80,6 @@ lxc.idmap = u 0 910000 10000
25 lxc.idmap = g 0 910000 10000
26 EOF
27
28-if command -v cgm >/dev/null 2>&1; then
29- cgm create all usernic-user
30- cgm chown all usernic-user $(id -u usernic-user) $(id -g usernic-user)
31- cgm movepid all usernic-user $$
32-elif [ -e /sys/fs/cgroup/cgmanager/sock ]; then
33- for d in $(cut -d : -f 2 /proc/self/cgroup); do
34- dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
35- --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Create \
36- string:$d string:usernic-user >/dev/null
37-
38- dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
39- --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Chown \
40- string:$d string:usernic-user int32:$(id -u usernic-user) int32:$(id -g usernic-user) >/dev/null
41-
42- dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
43- --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.MovePid \
44- string:$d string:usernic-user int32:$$ >/dev/null
45- done
46-else
47- for d in /sys/fs/cgroup/*; do
48- [ "$d" = "/sys/fs/cgroup/unified" ] && continue
49- [ -f $d/cgroup.clone_children ] && echo 1 > $d/cgroup.clone_children
50- [ ! -d $d/lxctest ] && mkdir $d/lxctest
51- chown -R usernic-user: $d/lxctest
52- echo $$ > $d/lxctest/tasks
53- done
54-fi
55-
56 mkdir -p /run/user/$(id -u usernic-user)
57 chown -R usernic-user: /run/user/$(id -u usernic-user) /home/usernic-user
58
59--
602.35.5
61