Systemd changes the cgroup of processes despite they configured with cgexec

Solution Unverified - Updated -

Issue

  • systemd changes the cgroup configured by cgexec

    $ cgexec -g memory:myapp.myapp myapp
    # cat /proc/3465959/cgroup
    12:memory:/myapp.myapp
    11:devices:/system.slice/gdm.service
    10:pids:/user.slice/user-1932628993.slice/session-2062.scope
    9:blkio:/system.slice/gdm.service
    8:perf_event:/
    7:freezer:/
    6:net_cls,net_prio:/
    5:cpu,cpuacct:/
    4:cpuset:/
    3:hugetlb:/
    2:rdma:/
    1:name=systemd:/user.slice/user-1932628993.slice/session-2062.scope 
    
    (After some minutes)
    
    # cat /proc/3465959/cgroup
    12:memory:/user.slice/user-1932628993.slice/session-2062.scope
    11:devices:/
    10:pids:/user.slice/user-1932628993.slice/session-2062.scope
    9:blkio:/
    8:perf_event:/
    7:freezer:/
    6:net_cls,net_prio:/
    5:cpu,cpuacct:/
    4:cpuset:/
    3:hugetlb:/
    2:rdma:/
    1:name=systemd:/user.slice/user-1932628993.slice/session-2062.scope 
    

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • libcgroup-tools
  • systemd

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content