Kernel
-
/proc: processes and the kernel as files
/proc is a filesystem where the kernel shows processes (/proc/<pid>) and its own state: memory, load, parameters.
11 minlsgrep -Els -l -
OOM killer: when memory runs out
A kernel mechanism: when memory runs out on the machine or in a cgroup with a limit, it kills a process with SIGKILL.
12 minjournalctl -ksystemctl showcat -
The kernel
What the Linux kernel is, what it does, and how to check its version and parameters.
4 minuname -runame -acat -
Kernel modules
Kernel modules: loading and unloading with modprobe, kernel messages in dmesg, module parameters.
4 minuname -rlsmodmodprobe -
dmesg — kernel messages: OOM, disk and filesystem errors, segfaults
dmesg prints the kernel ring buffer: messages about disks, filesystems, OOM, crashed programs and hardware.
9 mindmesg -Tdmesg -ldmesg -x -
sysctl — kernel parameters at runtime
sysctl reads and changes kernel parameters; -w lasts until reboot, a file in /etc/sysctl.d/ makes it permanent.
9 minsysctlsysctl -nsysctl -w -
Capabilities: root split into parts
Parts of root's rights: a process or a file gets only the one it needs, e.g. CAP_NET_BIND_SERVICE for a low port.
12 mingrepcapshgetpcaps -
cgroups and namespaces — how containers work
Isolation (namespaces) and resource limits (cgroups) — the foundation of containers and systemd.
6 minlsnssystemd-cglssystemd-cgtop