File: tools-cgroupv2

package info (click to toggle)
libcgroup 3.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,764 kB
  • sloc: ansic: 14,997; cpp: 9,957; python: 8,340; sh: 5,194; yacc: 470; makefile: 400; lex: 38
file content (31 lines) | stat: -rw-r--r-- 832 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

# Author: Santiago Ruano Rincón <santiago@debian.org>
# 2021-03-18
# License: GPLv3

# Test some of the tools included in cgroup-tools on cgroupv2 support

set -e

CGROUP2MOUNTED=$(grep cgroup2 /proc/mounts)
if [ "$CGROUP2MOUNTED" != 0 ]; then
  if [ ! "$AUTOPKGTEST_REBOOT_MARK" = "cgroupv2-prepare" ]; then
    sed -i '/GRUB_CMDLINE_LINUX_DEFAULT/ s/GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 systemd.unified_cgroup_hierarchy=true swapaccount=1"/' /etc/default/grub
    update-grub 2>&1
    /tmp/autopkgtest-reboot cgroupv2-prepare
  fi
fi

cat /proc/mounts | grep cgroup

echo "test cgcreate"
cgcreate -g cpuset:test
echo "test lscgroup"
lscgroup | grep test
echo "test cgset"
cgset -r cpuset.cpus=0 test
echo "test cgget"
cgget -g cpuset:test
echo "test cgcreate"
cgexec -g cpuset:test ls -l