Transitioning scripts relying on libcgroup-tools to the cgroup’s unified hierarchy (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings,

I am very aware this is not the place for user questions. This is also where 
the likelihood of an answer /at all/ are the highest. So, please bear with me; 
at the bottom[fn:1] are all the other places where I tried to find hints 
before posting here.

The issue is that I upgraded my computer to Fedora 32 from version 30, and 
broke some scripts in the process; they were relying on cgroup v1. The system-
wide change proposal submitted for Fedora 31[fn:2] and the associated release 
notes[fn:3], along with many other locations on the inter-webs, all seemed to 
indicate that adaptation to v2 would pass through systemd. The broken scripts 
do not invoke (not directly, strictly speaking) systemd at all. This citation 
is from the aforementioned release notes:

#+BEGIN_QUOTE
The tools or scripts should not require any changes, if they utilized the 
`systemd` interfaces.
#+END_QUOTE


Here is an example of how I wrote the scripts:


#+BEGIN_EG1 Bash
    # Configuring a group
    TGT='foo'
    GRP='woe'
    let M=(500 * 1024 * 1024)
    let C=250000

    cgcreate \
-a "${TGT}:${TGT}" \
-t "${TGT}:${TGT}" \
-g memory:"${GRP}" \
-g cpu:"${GRP}"

    printf "%d" "$M" > \ 
/sys/fs/cgroup/memory/"$GRP"/memory.limit_in_bytes

    printf "%d" "$C" > \
/sys/fs/cgroup/cpu/"$GRP"/cpu.cfs_quota_us

    # Using the new group
    cgexec --sticky -g "memory,cpu:${GRP}" <SOME-COMMAND>
#+END_EG1


That does not cut it anymore. The furthest I went to trying something else is 
editing this file:


#+BEGIN_EG2  /etc/cgconfig.conf
group woe {
    perm {
        task {
            uid = foo;
            gid = foo;
        }
    }

    memory {
        memory.high = 524288000;
    }

    cpu {
        cpu.max = 0500000 1000000;
    }
}
#+END_EG2


I believed that after a system reboot, systemd would create the cgroup `foo`. 
But nothing I could see/test happened. So, here is where your help would be 
greatly appreciated: how to use the `cgcreate` command and the like under 
libcgroup v2? Alternatively, if the way is by configuration files, where to 
create them and how to enforce what they stipulate? I do not mind *reading* 
literature on the subject, provided the assumed audience is a lay-user, not a 
kernel/container… developer.

Thanks in advance.

...
[fn:1] So far, to no avail,
1. I scanned various pages at [[licgroup’s upstream]][https://sourceforge.net/
projects/libcg/];
2. re-read some manuals;
3. posted at users@l.f.o;
4. went to places on the web…

[fn:2] Unified hierarchy proposal[[https://fedoraproject.org/wiki/Changes/
CGroupsV2]]

[fn:3] Release notes [[https://pagure.io/fork/quiet/fedora-docs/release-notes/
blob/06f98a01f9bbb437b0e51b2cba69ed2735483fa9/f/modules/release-notes/pages/
sysadmin/Kernel.adoc]]

_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux