systemd
-
Service
What a service is, how it differs from an ordinary program, and how to manage it.
5 minsystemctl statussystemctl startsystemctl stop -
journalctl — reading the systemd journal
Reading the systemd journal (journald) — filters by service, time, priority.
5 minjournalctl -ujournalctl -xeujournalctl -p -
systemd
The init system and service manager (PID 1): units, targets, dependencies, journals.
8 minsystemctl statussystemctl startsystemctl stop -
System boot and GRUB
How Linux boots: firmware, the GRUB bootloader, the kernel, systemd targets and emergency mode.
5 minupdate-grubgrub-installsystemctl get-default -
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 -
Boot targets: default, multi-user, rescue and emergency
A target is a group of units systemd brings the boot up to; rescue and emergency are the targets for repairs.
11 minsystemctl get-defaultsystemctl set-defaultsystemctl list-units -
systemd-analyze: what slows the boot and what is wrong in a unit
Breaks the boot down by time and by the chain of unit dependencies, and checks a unit file before the service runs.
11 minsystemd-analyzesystemd-analyze blamesystemd-analyze critical-chain -
systemctl — managing systemd services
The main interface to systemd. enable turns on autostart, start runs it now — these are different operations.
6 minsystemctl statussystemctl startsystemctl stop -
Cron — the task scheduler
Running tasks on a schedule: crontab syntax, classic cron and modern systemd timers.
6 mincrontab -ecrontab -lsystemctl list-timers -
ulimit and process limits: open files, processes, core
Process resource limits — open files, processes, core: ulimit, /proc/<pid>/limits and a service LimitNOFILE.
8 minulimit -aulimitulimit -Sn -
Service hardening: User=, ProtectSystem, NoNewPrivileges
Unit settings that strip a service of root, system writes and new privileges; systemd-analyze security rates them.
13 minsystemd-analyze securitysystemctl showsystemctl edit -
systemd timers — scheduled jobs
A systemd timer is a .timer unit that starts the service of the same name on a schedule; its output goes to the journal.
11 minsystemctl list-timerssystemctl enablesystemctl start -
timedatectl — time, time zone, and synchronization
Manages system time and NTP; set-time requires turning off set-ntp first, or the time reverts.
5 mintimedatectltimedatectl set-timezonetimedatectl set-ntp -
hostnamectl — host name and machine info
View and change the host name and machine info; /etc/hostname and /etc/hosts.
4 minhostnamectlhostname -fhostname -I