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