1

I am trying to create a cgroup hierarchy by following this tutorial

  • I installed the libcgroup package using
    dnf install libcgroup
    
    and the installation was successful.
  • I tried to check the status of the cgconfig config by running
    systemctl status cgconfig
    
    and I got the error
    Unit cgconfig.service could not be found.
    
  • I tried to enable the service, but I got the same error.
  • I tried to install the libcgroup package again, but I got the Nothing to do!, indicating that it is already installed.

I couldn't find the file /etc/cgconfig.conf. I installed the chkconfig command, but it appears that you start with it services that are in the /etc/rd.d/init.d directory (https://www.tecmint.com/chkconfig-command-examples/), and I have no such directory on my system.

I am on Fedora 33. Any advice or help would be very appreciated.

AdminBee
  • 22,803

2 Answers2

1

You're using a tutorial intended for Fedora 15, which still used cgroups implementation version 1. In Fedora 31, cgroups version 2 was introduced and enabled by default.

The chkconfig command and the /etc/rc.d/init.d directory are for the classic SysVinit-style services, and after Fedora introduced systemd (also in Fedora 15) it's been migrating away from the old SysVinit style as much as possible. It looks like in Fedora 33, the migration away from SysVinit style is pretty much complete and the compatibility layer for it is no longer installed by default, so /etc/rc.d/init.d directory no longer exists.

See Stephen Kitt's answer for the current recommended way to use cgroups. But if you want/need to use the old style:

In Fedora 33, the cgconfig service is now in package libcgroup-tools and has a systemd-style cgconfig.service file by default, so you won't need chkconfig. To make the old tutorial work, you might also have to fall back to cgroups v1 by using the kernel boot parameter systemd.unified_cgroup_hierarchy=0. (Disclaimer: that worked in Fedora 31 and 32, not sure about 33.)

telcoM
  • 96,466
1

The documentation you’re reading was written for Fedora 15, and is largely out of date.

In Fedora 33, a cgroup v2 hierarchy is used by default, and managed by systemd. You can inspect it using systemd-cgls, and monitor it with systemd-cgtop. To create new “slices” in the hierarchy, and run commands inside them, use systemd-run.

Units can also be given permanent resource constraints of their own; a number of options can be used to specify limits directly (CPUQuote, MemoryLimit etc.), and slices can be specified explicitly too (Slice).

Stephen Kitt
  • 434,908