1

When I try to create a pids controller in cgroup2, I get

bash: echo: write error: No such file or directory

What am I doing wrong,

# cd /sys/fs/cgroup/unified
# mkdir newgroup
# cd newgroup/
# echo '+pids' > cgroup.subtree_control 
bash: echo: write error: No such file or directory

Basic diagnostics,

Note, for context this is after I unmounted cgroup v1, and cleaned up.

$ mount | grep -i cgroup
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)

$ stat cgroup.subtree_control 
  File: cgroup.subtree_control
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 1dh/29d Inode: 1537        Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-12-27 18:53:19.700799276 -0600
Modify: 2020-12-27 18:53:19.696582125 -0600
Change: 2020-12-27 18:53:19.696582125 -0600
 Birth: -
Evan Carroll
  • 30,763
  • 48
  • 183
  • 315

1 Answers1

0

I think your system has enabled cgroup v1 already. You should disable it via adding cgroup_no_v1=memory in the boot command.

Simply put,

  1. $vi /etc/default/grub

  2. Add "cgroup_no_v1=all systemd.unified_cgroup_hierachy=1" in GRUB_CMDLINE_LINUX_DEFAULT

  3. $grub-reboot; reboot

You need to do this with sudo.