cgroups

Aus Foxwiki


cgroup tree

# $ systemd-cgls
└ system
  ├ 1 /usr/lib/systemd/systemd --system --deserialize 18
  ├ ntpd.service
  │ └ 8471 /usr/sbin/ntpd -u ntp:ntp -g
  ├ upower.service
  │ └ 798 /usr/libexec/upowerd
  ├ wpa_supplicant.service
  │ └ 751 /usr/sbin/wpa_supplicant -u -f /var/log/wpa_supplicant.log -c /etc/wpa_supplicant/wpa_supplicant.conf -u -f /var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid
  ├ nfs-idmap.service
  │ └ 731 /usr/sbin/rpc.idmapd
  ├ nfs-rquotad.service
  │ └ 753 /usr/sbin/rpc.rquotad
  ├ nfs-mountd.service
  │ └ 732 /usr/sbin/rpc.mountd
  ├ nfs-lock.service
  │ └ 704 /sbin/rpc.statd
  ├ rpcbind.service
  │ └ 680 /sbin/rpcbind -w
  ├ postfix.service
  │ ├   859 /usr/libexec/postfix/master
  │ ├   877 qmgr -l -t fifo -u
  │ └ 32271 pickup -l -t fifo -u
  ├ colord-sane.service
  │ └ 647 /usr/libexec/colord-sane
  ├ udisks2.service
  │ └ 615 /usr/lib/udisks2/udisksd --no-debug
  ├ colord.service
  │ └ 607 /usr/libexec/colord
  ├ prefdm.service
  │ ├ 567 /usr/sbin/gdm-binary -nodaemon
  │ ├ 602 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1
  │ ├ 612 /usr/bin/Xorg :0 -br -verbose -auth /var/run/gdm/auth-for-gdm-O00GPA/database -seat seat0 -nolisten tcp
  │ └ 905 gdm-session-worker [pam/gdm-password]
  ├ systemd-ask-password-wall.service
  │ └ 645 /usr/bin/systemd-tty-ask-password-agent --wall
  ├ atd.service
  │ └ 544 /usr/sbin/atd -f
  ├ ksmtuned.service
  │ ├  548 /bin/bash /usr/sbin/ksmtuned
  │ └ 1092 sleep 60
  ├ dbus.service
  │ ├ 586 /bin/dbus-daemon --system --address=systemd: --nofork --systemd-activation
  │ ├ 601 /usr/libexec/polkit-1/polkitd --no-debug
  │ └ 657 /usr/sbin/modem-manager
  ├ cups.service
  │ └ 508 /usr/sbin/cupsd -f
  ├ avahi-daemon.service
  │ ├ 506 avahi-daemon: running [epsilon.local]
  │ └ 516 avahi-daemon: chroot helper
  ├ system-setup-keyboard.service
  │ └ 504 /usr/bin/system-setup-keyboard
  ├ accounts-daemon.service
  │ └ 502 /usr/libexec/accounts-daemon
  ├ systemd-logind.service
  │ └ 498 /usr/lib/systemd/systemd-logind
  ├ crond.service
  │ └ 486 /usr/sbin/crond -n
  ├ NetworkManager.service
  │ ├  484 /usr/sbin/NetworkManager --no-daemon
  │ └ 8437 /sbin/dhclient -d -4 -sf /usr/libexec/nm-dhcp-client.action -pf /var/run/dhclient-wlan0.pid -lf /var/lib/dhclient/dhclient-903b6f6aa7a1-46c8-82a9-7f637dfbb3e4-wlan0.lease -cf /var/run/nm-d...
  ├ libvirtd.service
  │ ├ 480 /usr/sbin/libvirtd
  │ └ 571 /sbin/dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file= --except-interface lo --listenaddress 192.168.122.1 --dhcp-range 192.168.122.2,1...
  ├ bluetooth.service
  │ └ 479 /usr/sbin/bluetoothd -n
  ├ systemd-udev.service
  │ └ 287 /usr/lib/systemd/systemd-udevd
  └ systemd-journald.service
    └ 280 /usr/lib/systemd/systemd-journald

ps with cgroups

$ alias psc='ps xawf -eo pid,user,cgroup,args'
$ psc
  PID USER     CGROUP                              COMMAND
...
    1 root     name=systemd:/systemd-1             /bin/systemd systemd.log_target=kmsg systemd.log_level=debug selinux=0
  415 root     name=systemd:/systemd-1/sysinit.service /sbin/udevd -d
  928 root     name=systemd:/systemd-1/atd.service /usr/sbin/atd -f
  930 root     name=systemd:/systemd-1/ntpd.service /usr/sbin/ntpd -n
  932 root     name=systemd:/systemd-1/crond.service /usr/sbin/crond -n
  935 root     name=systemd:/systemd-1/auditd.service /sbin/auditd -n
  943 root     name=systemd:/systemd-1/auditd.service  \_ /sbin/audispd
  964 root     name=systemd:/systemd-1/auditd.service      \_ /usr/sbin/sedispatch
  937 root     name=systemd:/systemd-1/acpid.service /usr/sbin/acpid -f
  941 rpc      name=systemd:/systemd-1/rpcbind.service /sbin/rpcbind -f
  944 root     name=systemd:/systemd-1/rsyslog.service /sbin/rsyslogd -n -c 4
  947 root     name=systemd:/systemd-1/systemd-logger.service /lib/systemd/systemd-logger
  950 root     name=systemd:/systemd-1/cups.service /usr/sbin/cupsd -f
  955 dbus     name=systemd:/systemd-1/messagebus.service /bin/dbus-daemon --system --address=systemd: --nofork --systemd-activation
  969 root     name=systemd:/systemd-1/getty@.service/tty6 /sbin/mingetty tty6
  970 root     name=systemd:/systemd-1/getty@.service/tty5 /sbin/mingetty tty5
  971 root     name=systemd:/systemd-1/getty@.service/tty1 /sbin/mingetty tty1
  973 root     name=systemd:/systemd-1/getty@.service/tty4 /sbin/mingetty tty4
  974 root     name=systemd:/user/lennart/2        login -- lennart
 1824 lennart  name=systemd:/user/lennart/2         \_ -bash
  975 root     name=systemd:/systemd-1/getty@.service/tty3 /sbin/mingetty tty3
  988 root     name=systemd:/systemd-1/polkitd.service /usr/libexec/polkit-1/polkitd
  994 rtkit    name=systemd:/systemd-1/rtkit-daemon.service /usr/libexec/rtkit-daemon
...