Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
systemd puts every service, user session and container in its own cgroup, grouped in slices: system.slice, user.slice, machine.slice. systemd-cgls shows which process belongs to which service — useful when ps does not tell you where a process comes from. systemd-cgtop shows CPU, memory and I/O per cgroup, like top.
Zo schrijf je het
systemd-cgls [OPTION]... [CGROUP...]
systemd-cgls [OPTION]... --unit|--user-unit [UNIT...]
systemd-cgtop [OPTION]... [GROUP]Opties 26
Meest gebruikt
systemd-cgls
systemd-cgtop
Niets past bij dit filter.
Voorbeelden 10
$ als gewone gebruiker# als root (of met sudo)
1The whole tree
systemd-cgls --no-pager | head -25Slices, services and their processes.
2One service
systemd-cgls -u httpd.serviceAll processes of the web server, also CGI children.
3Where does this process come from?
systemctl status 4123Shows the unit and cgroup of a PID.
4Your own session
systemd-cgls -u user-1000.sliceEverything you started.
5Live resource use per service
systemd-cgtopPress m, c, i to sort.
6Sorted by memory, one snapshot
systemd-cgtop -m -1 -b | headFor a report.
7Container processes
systemd-cgls -u machine.sliceVMs and containers.
8Cgroup of a process directly
cat /proc/4123/cgroup 0::/system.slice/httpd.servicecgroup v2 path.
9Limit a service with cgroups
systemctl set-property httpd.service MemoryMax=1G CPUQuota=50%Resource limits are set on the cgroup.
10Find hidden processes of a service (security)
systemd-cgls -u sshd.serviceA strange child (like a miner) under a service shows up here.
Niets past bij dit filter.
Exitcodes
0 :: Done. 1 :: Error.