systemd

0%
Theory
Quiz

    Fundamentals & Architecture

    • What are systemd targets, and how do they conceptually replace SysVinit runlevels? Name some common targets.

      Junior
    • What is systemd and what is its role in Linux?

      Junior
    • Explain the concept of a 'unit' in systemd.

      Junior
    • Discuss the architectural differences between systemd and SysVinit, including key advantages like parallelization and dependency management.

      Mid
    • Explain systemd's role as PID 1 during the Linux boot process and how it brings up services according to the default target.

      Mid
    • What are some key components of the systemd suite beyond the core service manager, and what is the purpose of each?

      Mid
    • Discuss the criticisms and design philosophy debates surrounding systemd, particularly regarding its scope and feature creep.

      Senior

    Unit Files Fundamentals

    • Describe the typical structure of a systemd service unit file, including the main sections and the purpose of each.

      Junior
    • Why is systemctl daemon-reload necessary after modifying unit files?

      Junior
    • What is a systemd unit, and what are the different types of unit files, and when would you use each?

      Junior
    • How do you configure the options and behavior of services using .service files in systemd?

      Junior
    • Where are systemd unit files stored on the filesystem, and what is the precedence order when multiple definitions exist for the same unit?

      Mid
    • How do you safely override or extend vendor-supplied unit files, and what are drop-in files?

      Mid
    • What are the best practices for writing robust and maintainable systemd unit files?

      Senior

    Template & Helper Units

    • What is the purpose of systemd-sysusers?

      Mid
    • What is a template unit in systemd, and when would you use instantiated units like foo@.service?

      Mid
    • What is tmpfiles.d, and how does systemd-tmpfiles manage creation and cleanup of files and directories?

      Mid
    • What is systemd-run, and when would you create a transient unit with it?

      Mid
    • Explain the purpose of the %i, %I, and %n specifiers in systemd unit files, especially for template units.

      Senior

    Managing Services With Systemctl

    • What is the fundamental difference between systemctl start and systemctl enable?

      Junior
    • How do you manage services with systemctl (start, stop, enable, disable, check status)?

      Junior
    • How would you check the status of a systemd service and interpret its output?

      Junior
    • What do systemctl is-active, is-enabled, and is-failed report, and how are they useful in scripts?

      Junior
    • What does systemctl enable --now do, and how does it combine two operations?

      Junior
    • What does systemctl mask do, and how does it differ from systemctl disable?

      Mid
    • Explain the difference between systemctl restart and systemctl reload, and when would you use reload-or-restart?

      Mid
    • What does systemctl isolate do, and when would you use it?

      Mid
    • What is the difference between systemctl cat and systemctl show for inspecting a unit?

      Mid
    • How does enabling a unit create .wants symlinks, and what role does the [Install] section's WantedBy play?

      Mid

    Service Unit Directives

    • How do Environment= and EnvironmentFile= work for passing configuration to a service?

      Junior
    • Explain the Type directive in the [Service] section and its common values, and how the chosen type affects systemd's understanding of service readiness.

      Mid
    • Describe the Restart directive and its various options, and how systemd uses it to ensure service reliability.

      Mid
    • Explain the ExecStart, ExecStartPre, ExecStartPost, ExecStop, and ExecReload directives, their execution order, and how to handle failures in pre/post commands.

      Mid
    • What is the purpose of RemainAfterExit=yes in a service unit, particularly for Type=oneshot services?

      Mid
    • When would you use PIDFile= in a service unit?

      Mid
    • How does Type=forking work, and why is a PIDFile important for it?

      Mid
    • How does systemd capture a service's stdout and stderr, and how do StandardOutput/StandardError directives control this?

      Mid
    • How does the sd_notify readiness protocol work, and when would you use Type=notify?

      Senior
    • How do KillMode and KillSignal control how systemd stops a service's processes?

      Senior

    Service Reliability & Restart

    • What is the purpose of RestartSec, and how does it interact with the Restart policy?

      Junior
    • Explain TimeoutStartSec and TimeoutStopSec and their role in service management.

      Mid
    • What is the OnFailure= directive, and how would you use it to trigger recovery actions?

      Mid
    • What is WatchdogSec in a service unit, and how does it contribute to service reliability?

      Senior
    • Explain StartLimitIntervalSec and StartLimitBurst and how they interact with the Restart directive.

      Senior

    Journald & Logging

    • How do you use journalctl to view logs for a specific service, filter by time, or view logs from previous boots?

      Junior
    • What is systemd-journald, and how do you interact with its logs using journalctl?

      Junior
    • How can you view logs from the previous system boot using journalctl?

      Junior
    • Describe systemd-journald — what are the advantages of its structured, centralized logging compared to plain-text log files and syslog?

      Mid
    • How can you configure journald for persistent logging across reboots?

      Mid
    • How do you filter journalctl output by time, priority, or specific fields?

      Mid
    • Describe the difference between persistent and volatile storage for the systemd journal.

      Mid
    • How can you limit the size of the journal and control its rotation and vacuuming?

      Mid
    • How does journald forward logs to a traditional syslog daemon, and why might you keep both?

      Mid
    • What output formats does journalctl support with -o, and when would you use JSON output?

      Mid

    Timers & Scheduling

    • How do you associate a .timer unit with a .service unit?

      Junior
    • What is systemctl list-timers, and what information does it show about scheduled timers?

      Junior
    • Compare and contrast systemd timers with traditional cron jobs — what are the key advantages of using systemd timers?

      Mid
    • Explain the difference between OnCalendar= and monotonic timers like OnBootSec and OnUnitActiveSec.

      Mid
    • What is Persistent=true in a timer unit, and how does it affect missed job executions?

      Mid
    • Are there any scenarios where cron might still be preferred over systemd timers?

      Mid
    • What do AccuracySec and RandomizedDelaySec do in a timer unit, and why would you use RandomizedDelaySec?

      Senior

    Dependencies & Ordering

    • Explain the difference between After= and Before= for ordering units.

      Junior
    • How do you list the dependencies of a unit, and what does systemctl list-dependencies show?

      Junior
    • Explain the systemd dependency model — what is the crucial distinction between requirement dependencies like Wants and Requires and ordering dependencies like After and Before?

      Mid
    • Why is it common to specify both a Wants (or Requires) and an After directive for a service that depends on another?

      Mid
    • What is the purpose of the Conflicts directive in a unit file?

      Mid
    • Explain the difference between Wants= and Requires= in a unit file.

      Mid
    • What is the purpose of the BindsTo= and Conflicts= directives?

      Mid
    • What is the difference between Requires= and Requisite=?

      Senior
    • What does PartOf= do, and how does it differ from BindsTo=?

      Senior
    • What is DefaultDependencies=, and why might you set it to no for certain units?

      Senior
    • How does systemd's job and transaction model work when you start a unit?

      Senior

    Targets & Boot Process

    • Name some common systemd targets and describe their typical uses.

      Junior
    • How do you change the default systemd target?

      Junior
    • How does systemd-analyze help in understanding and optimizing the Linux boot process, and what information do blame and critical-chain give you?

      Mid
    • What is the difference between the rescue and emergency targets?

      Mid
    • What are sysinit.target and basic.target, and where do they fit in the boot ordering?

      Senior

    Resource Control & Cgroups

    • Name some systemd unit file directives you can use to control CPU, memory, or I/O resources for a service.

      Mid
    • How do systemd-cgls and systemd-cgtop help you inspect the cgroup hierarchy and resource usage?

      Mid
    • How does systemd utilize cgroups to manage and control resources like CPU, memory, and I/O for individual services?

      Senior
    • Explain the concept of the slice hierarchy in systemd and how it relates to cgroups.

      Senior
    • What is the difference between cgroup v1 and the cgroup v2 unified hierarchy, and how does systemd use it?

      Senior
    • What is the difference between MemoryMax, MemoryHigh, and MemoryMin in a service unit?

      Senior

    Security Hardening

    • How do User= and Group= directives enhance service security?

      Junior
    • What is the difference between ProtectSystem and ProtectHome, and what protection do they provide?

      Mid
    • What does PrivateTmp=yes do for a service, and why is it useful?

      Mid
    • Name and explain some systemd-specific security hardening directives you can apply in a service unit file.

      Senior
    • How can the systemd-analyze security command help identify and improve the security posture of a service?

      Senior
    • What does DynamicUser=yes do, and what are the tradeoffs of using it?

      Senior

    Mount Path & Scope Units

    • Explain how systemd manages mount points using .mount units.

      Mid
    • What are .path units in systemd, and how do they let you activate a service in response to filesystem changes?

      Mid
    • What are .automount units, and how do they differ from .mount units for on-demand mounting?

      Mid
    • What is a .scope unit, and how does it differ from a .service unit?

      Senior

    User Sessions & Logind

    • What is the systemd per-user manager, and how does systemctl --user differ from the system manager?

      Mid
    • What is systemd-logind responsible for, and how does it manage sessions and seats?

      Mid
    • How does logind handle power events such as the power button or laptop lid, and how would you change that behaviour?

      Mid
    • What is loginctl enable-linger, and when do you need it for user services?

      Senior

    Socket Activation & Troubleshooting

    • Outline a systematic approach to troubleshoot a systemd service that fails to start or behaves unexpectedly.

      Mid
    • Explain the role of both .socket and .service units in implementing socket activation.

      Mid
    • What does systemd-analyze verify do, and how does it help validate unit files?

      Mid
    • What is systemd socket activation? Explain its core mechanism and the benefits it provides.

      Senior
    • What is the difference between Accept=yes and Accept=no in a socket unit?

      Senior