Linux OS Internals (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
How do Systemd Units and Service Management work?
senior LevelSystem Design
In Simple Words: Systemd manages system initialization, background daemons, and cgroups:
- Unit Files (
/etc/systemd/system/myapp.service):[Unit]: Metadata, dependencies (After=network.target).[Service]: Execution command (ExecStart), restart policy (Restart=always), sandboxing.[Install]: Target dependency (WantedBy=multi-user.target).
- Core CLI commands:
systemctl start/stop/restart/status/enable myapp, andjournalctl -u myapp -ffor log streaming.