File: tools-cgroupv1

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 (30 lines) | stat: -rw-r--r-- 902 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
#!/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 cgroupv1 support

set -e

if [ ! -d /sys/fs/cgroup/memory ]; then
  if [ ! "$AUTOPKGTEST_REBOOT_MARK" = "cgroupv1-prepare" ]; then
    sed -i '/GRUB_CMDLINE_LINUX_DEFAULT/ s/GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 systemd.unified_cgroup_hierarchy=false systemd.legacy_systemd_cgroup_controller=false cgroup_enable=cpu cgroup_enable=cpuset cgroup_enable=memory swapaccount=1"/' /etc/default/grub
    update-grub 2>&1
    /tmp/autopkgtest-reboot cgroupv1-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