amazonlinux / amazon-linux-2023

Amazon Linux 2023
https://aws.amazon.com/linux/amazon-linux-2023/
Other
522 stars 39 forks source link

[Bug] - libcgroup fails to create cgroup #598

Open yufengzheng4 opened 9 months ago

yufengzheng4 commented 9 months ago

Describe the bug Failed to create cgroup through the libcgroup. It was working on Amazon Linux 2.

To Reproduce Steps to reproduce the behavior:

  1. Create a conf file as: /etc/cgconfig.conf
  2. Run: /usr/sbin/cgconfigparser -l /etc/cgconfig.conf
  3. See error: /usr/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup, requested group parameter does not exist

I could not find anything wrong with my conf file: /etc/cgconfig.conf:

group scriptslimit {
    perm {
        task {
            uid = myagent;
            gid = mygroup;
        }
        admin {
            uid = myagent;
            gid = mygroup;
        }
    }
    cpu {
        cpu.shares = 512;
    }
    memory {
        memory.limit_in_bytes = 2g;
    }
}

libcgroup package:

[root@pop ec2-user]# dnf list installed | grep libcgroup
libcgroup.x86_64                        3.0-1.amzn2023.0.1                 @amazonlinux
libcgroup-tools.x86_64                  3.0-1.amzn2023.0.1                 @amazonlinux
[root@pop ec2-user]#  cat /etc/os-release
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
SUPPORT_END="2028-03-15"

Expected behavior cgroup created successfully

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):