0

I have freshly provisioned Linode instance with Fedora 34. The only thing I have installed on it is libcgroup. cgconfig service is starting properly and there are no errors but the subsystem is not working.

I am getting the following error when I execute lscgroup command.

[root@localhost ~]# sudo lscgroup
cgroups can't be listed: Cgroup is not mounted

Further on the topic, when I execute lssubsys -am command I get the following

cpu
cpuacct
blkio
memory
devices
freezer
net_cls
perf_event
net_prio
hugetlb
pids
misc

can anyone please help me solve this problem?

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940

1 Answers1

0

Answering my own question. After banging my head for 4 days I have found a solution. The actual issue is Fedora specifically and other Linux systems generally have moved from CGroup v1 to v2 by default as a unified subsystem. So was in my case, I was trying to set up CGroup V1 controllers whereas my Fedora 34 OS was running CGroup V2, which was causing my CGConfig service to crash upon restart. The solution was to move to CGroup V1 and to do this run the following command

Add systemd.unified_cgroup_hierarchy=0 to the default GRUB config with sed.

sudo sed -i '/^GRUB_CMDLINE_LINUX/ s/"$/ systemd.unified_cgroup_hierarchy=0"/' /etc/default/grub

Now rebuild your GRUB config.

If you’re using BIOS boot then it’s this.

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

If you’re running EFI, then it’s this.

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Now reboot and make sure Docker can start!

The original solution was posted on this blog.

https://blog.christophersmart.com/2019/12/15/enabling-docker-in-fedora-31-by-reverting-to-cgroups-v1/

  • This also means _you_ should be moving to cgroup v2. It's supported in docker 20.10 and later. – Michael Hampton Aug 10 '21 at 17:17
  • I am pretty green on cgroup v2 and the application I was trying to set up uses v1. So I had only two options either to modify the application or to move back to v1. I know in the future v1 would eventually be deprecated but for now, this will give me enough time to learn v2 and make changes in the application to support it. – Albert Lilly Aug 12 '21 at 09:55