Quit scratching your head over who created that lonely cgroup
Container Basics On Linux (Namespaces/Cgroups)
Quit scratching your head over who created that lonely cgroup
🧩 The Challenge
Dealing with a production server where mysterious cgroups keep popping up, but `ps` doesn’t show any parent process associated with them. It’s annoying as hell when you’re trying to clean up resources and you have no clue which container runtime or manual hack left them behind.
💡 The Fix
Just look at the process ID recorded in the cgroup’s own `cgroup.procs` file or map the cgroup path to its underlying owner using the `cgroup.controllers` file status. It stops you from playing detective with a thousand PID lookups.
cat /sys/fs/cgroup/system.slice/your_mysterious.scope/cgroup.procs
⚙️ Why It Works
Every cgroup directory carries a list of PIDs currently pinned inside it, meaning you can just cat the file to see exactly which processes are refusing to die. The kernel keeps this file updated live, so you’re seeing the truth instead of what a stale management daemon wants you to believe.
🚀 Pro-Tip: If that file is empty, check `cgroup.events` to see if the group is just a zombie waiting for a kernel cleanup.
Linux Tips & Tricks | © ngelinux.com | 11/12/2026
