Skip to main content
InterviewHubPRO
Section Overview
Q20

Question 20 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

40%
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, and journalctl -u myapp -f for log streaming.