Timers & Scheduling
Are there any scenarios where cron might still be preferred over systemd timers?
Compare and contrast systemd timers with traditional cron jobs — what are the key advantages of using systemd timers?
Explain the difference between OnCalendar= and monotonic timers like OnBootSec and OnUnitActiveSec.
How do you associate a .timer unit with a .service unit?
What do AccuracySec and RandomizedDelaySec do in a timer unit, and why would you use RandomizedDelaySec?
What is Persistent=true in a timer unit, and how does it affect missed job executions?
What is systemctl list-timers, and what information does it show about scheduled timers?
Journald & Logging
Describe systemd-journald — what are the advantages of its structured, centralized logging compared to plain-text log files and syslog?
Describe the difference between persistent and volatile storage for the systemd journal.
How can you configure journald for persistent logging across reboots?
How can you limit the size of the journal and control its rotation and vacuuming?
How can you view logs from the previous system boot using journalctl?
How do you filter journalctl output by time, priority, or specific fields?
How do you use journalctl to view logs for a specific service, filter by time, or view logs from previous boots?
How does journald forward logs to a traditional syslog daemon, and why might you keep both?
What is systemd-journald, and how do you interact with its logs using journalctl?
What output formats does journalctl support with -o, and when would you use JSON output?
Service Unit Directives
Describe the Restart directive and its various options, and how systemd uses it to ensure service reliability.
Explain the ExecStart, ExecStartPre, ExecStartPost, ExecStop, and ExecReload directives, their execution order, and how to handle failures in pre/post commands.
Explain the Type directive in the [Service] section and its common values, and how the chosen type affects systemd's understanding of service readiness.
How do Environment= and EnvironmentFile= work for passing configuration to a service?
How do KillMode and KillSignal control how systemd stops a service's processes?
How does systemd capture a service's stdout and stderr, and how do StandardOutput/StandardError directives control this?
How does the sd_notify readiness protocol work, and when would you use Type=notify?
How does Type=forking work, and why is a PIDFile important for it?
What is the purpose of RemainAfterExit=yes in a service unit, particularly for Type=oneshot services?
When would you use PIDFile= in a service unit?
Unit Files Fundamentals
Describe the typical structure of a systemd service unit file, including the main sections and the purpose of each.
How do you configure the options and behavior of services using .service files in systemd?
How do you safely override or extend vendor-supplied unit files, and what are drop-in files?
What are the best practices for writing robust and maintainable systemd unit files?
What is a systemd unit, and what are the different types of unit files, and when would you use each?
Where are systemd unit files stored on the filesystem, and what is the precedence order when multiple definitions exist for the same unit?
Why is systemctl daemon-reload necessary after modifying unit files?
Fundamentals & Architecture
Discuss the architectural differences between systemd and SysVinit, including key advantages like parallelization and dependency management.
Discuss the criticisms and design philosophy debates surrounding systemd, particularly regarding its scope and feature creep.
Explain systemd's role as PID 1 during the Linux boot process and how it brings up services according to the default target.
Explain the concept of a 'unit' in systemd.
What are some key components of the systemd suite beyond the core service manager, and what is the purpose of each?
What are systemd targets, and how do they conceptually replace SysVinit runlevels? Name some common targets.
What is systemd and what is its role in Linux?
Mount Path & Scope Units
Explain how systemd manages mount points using .mount units.
What are .automount units, and how do they differ from .mount units for on-demand mounting?
What are .path units in systemd, and how do they let you activate a service in response to filesystem changes?
What is a .scope unit, and how does it differ from a .service unit?
Service Reliability & Restart
Explain StartLimitIntervalSec and StartLimitBurst and how they interact with the Restart directive.
Explain TimeoutStartSec and TimeoutStopSec and their role in service management.
What is the OnFailure= directive, and how would you use it to trigger recovery actions?
What is the purpose of RestartSec, and how does it interact with the Restart policy?
What is WatchdogSec in a service unit, and how does it contribute to service reliability?
Resource Control & Cgroups
Explain the concept of the slice hierarchy in systemd and how it relates to cgroups.
How do systemd-cgls and systemd-cgtop help you inspect the cgroup hierarchy and resource usage?
How does systemd utilize cgroups to manage and control resources like CPU, memory, and I/O for individual services?
Name some systemd unit file directives you can use to control CPU, memory, or I/O resources for a service.
What is the difference between cgroup v1 and the cgroup v2 unified hierarchy, and how does systemd use it?
What is the difference between MemoryMax, MemoryHigh, and MemoryMin in a service unit?
Dependencies & Ordering
Explain the difference between After= and Before= for ordering units.
Explain the difference between Wants= and Requires= in a unit file.
Explain the systemd dependency model — what is the crucial distinction between requirement dependencies like Wants and Requires and ordering dependencies like After and Before?
How do you list the dependencies of a unit, and what does systemctl list-dependencies show?
How does systemd's job and transaction model work when you start a unit?
What does PartOf= do, and how does it differ from BindsTo=?
What is DefaultDependencies=, and why might you set it to no for certain units?
What is the difference between Requires= and Requisite=?
What is the purpose of the BindsTo= and Conflicts= directives?
What is the purpose of the Conflicts directive in a unit file?
Why is it common to specify both a Wants (or Requires) and an After directive for a service that depends on another?
Managing Services With Systemctl
Explain the difference between systemctl restart and systemctl reload, and when would you use reload-or-restart?
How do you manage services with systemctl (start, stop, enable, disable, check status)?
How does enabling a unit create .wants symlinks, and what role does the [Install] section's WantedBy play?
How would you check the status of a systemd service and interpret its output?
What do systemctl is-active, is-enabled, and is-failed report, and how are they useful in scripts?
What does systemctl enable --now do, and how does it combine two operations?
What does systemctl isolate do, and when would you use it?
What does systemctl mask do, and how does it differ from systemctl disable?
What is the difference between systemctl cat and systemctl show for inspecting a unit?
What is the fundamental difference between systemctl start and systemctl enable?
Template & Helper Units
Explain the purpose of the %i, %I, and %n specifiers in systemd unit files, especially for template units.
What is a template unit in systemd, and when would you use instantiated units like foo@.service?
What is systemd-run, and when would you create a transient unit with it?
What is the purpose of systemd-sysusers?
What is tmpfiles.d, and how does systemd-tmpfiles manage creation and cleanup of files and directories?
Socket Activation & Troubleshooting
Explain the role of both .socket and .service units in implementing socket activation.
Outline a systematic approach to troubleshoot a systemd service that fails to start or behaves unexpectedly.
What does systemd-analyze verify do, and how does it help validate unit files?
What is systemd socket activation? Explain its core mechanism and the benefits it provides.
What is the difference between Accept=yes and Accept=no in a socket unit?
Security Hardening
How can the systemd-analyze security command help identify and improve the security posture of a service?
How do User= and Group= directives enhance service security?
Name and explain some systemd-specific security hardening directives you can apply in a service unit file.
What does DynamicUser=yes do, and what are the tradeoffs of using it?
What does PrivateTmp=yes do for a service, and why is it useful?
What is the difference between ProtectSystem and ProtectHome, and what protection do they provide?
Targets & Boot Process
How do you change the default systemd target?
How does systemd-analyze help in understanding and optimizing the Linux boot process, and what information do blame and critical-chain give you?
Name some common systemd targets and describe their typical uses.
What are sysinit.target and basic.target, and where do they fit in the boot ordering?
What is the difference between the rescue and emergency targets?
User Sessions & Logind
How does logind handle power events such as the power button or laptop lid, and how would you change that behaviour?
What is loginctl enable-linger, and when do you need it for user services?
What is systemd-logind responsible for, and how does it manage sessions and seats?
What is the systemd per-user manager, and how does systemctl --user differ from the system manager?