Services and systemd
20 articles, grouped by kind; the order follows the tracks.
Concepts 5
-
Service
What a service is, how it differs from an ordinary program, and how to manage it.
5 minsystemctl statussystemctl startsystemctl stop -
systemd
The init system and service manager (PID 1): units, targets, dependencies, journals.
8 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 -
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 -
KVM and libvirt
Virtual machines on Linux — managed with virsh, networks, storage, console.
4 minvirsh listvirsh startvirsh shutdown
Commands 3
-
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 -
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
Services 12
-
nginx — web server and reverse proxy
nginx serves sites from disk and forwards requests to applications; it picks a site by Host, nginx -t checks the config.
13 minnginx -tsystemctl reloadnginx -T -
PostgreSQL — access, pg_hba.conf, dump and restore
PostgreSQL is a relational DBMS: roles and databases, pg_hba.conf access rules, pg_dump dumps and pg_restore restores.
14 minsystemctl startpg_lsclusterspsql -h -
Redis — in-memory key-value store
Cache, queues, and sessions in RAM; KEYS * blocks the server on large databases — use --scan instead.
5 minredis-cli pingredis-cli inforedis-cli --bigkeys -
chrony: time synchronization over NTP
An NTP client and server: keeps the system clock in step with time servers and can serve time to your machines.
13 minchronyc trackingchronyc sourceschronyc sourcestats -
Prometheus — metrics collection
Collecting metrics with a pull model — targets, PromQL, exporters, alerts.
3 minpromtool checkcurl -
Grafana — dashboards
Visualizing metrics and logs — data sources, dashboards, variables, alerts.
4 minsystemctl statusss -tlnpgrafana-cli admin -
Samba — file sharing over SMB
An SMB server for Windows-compatible shares; the SMB password is separate from the system one, easy to forget to set.
5 minsmbpasswd -atestparmsmbstatus -
Postfix — a mail server
Sending and receiving mail — config, the queue, logs, typical delivery debugging.
4 minpostconf -nmailqpostqueue -f -
BIND9 — DNS server
Running your own DNS — zones, records, config checks, resolving debug.
3 minnamed-checkconfnamed-checkzonerndc reload -
DHCP server
Handing out addresses on a network — pool, reservations, leases, diagnostics.
3 mindhcpd -tcatjournalctl -u -
HAProxy — load balancer
Load balancing and proxying TCP/HTTP — backends, health checks, statistics.
4 minhaproxy -csystemctl reloadecho -
keepalived — high availability with VRRP
High availability through a virtual IP — failover between nodes using VRRP.
4 minip ajournalctl -u
Nothing found. Try a shorter query.