systemd
The init system on nearly every modern Linux distribution: units and targets, the service lifecycle, dependency-driven boot, journald logging, timers, and socket activation. Interviewers ask about systemd because writing a correct unit file and reading journalctl are baseline skills for anyone who ships to Linux.
on this pageshowhide
explore
- Units and Targets6 questions
- Service Lifecycle6 questions
- Dependencies and Ordering6 questions
- journald Logging5 questions
- Timers vs Cron6 questions
- Socket Activation6 questions
questions
page 2 of 2In systemd, what is a template unit such as [email protected], how do you start and enable one instance of it, and what do the %i and %I specifiers expand to inside the unit file?
basics
~20 sA template unit has an @ before its suffix and is never run directly; you run instances of it, such as [email protected]. Inside the file, %i expands to the instance name as written and %I to its unescaped form.
On a slow-booting systemd host, systemd-analyze blame reports that a unit took 25 seconds, but disabling it does not shorten the boot at all. Why can blame mislead, and which systemd-analyze subcommand answers "what is actually delaying the boot"?
basics
~20 sblame ranks units by how long each took to initialise, ignoring the dependency graph, so a slow unit nothing waits for costs nothing. systemd-analyze critical-chain walks the ordering chain into the boot target and shows which delays actually accumulated.
A busy service's log lines go missing from the systemd journal during traffic spikes, and the journal itself contains a line saying messages from that unit were suppressed. What is systemd-journald doing, and which settings control it?
basics
~20 sjournald rate-limits each service separately: past roughly 10000 messages in 30 seconds it drops the remainder and logs a suppression notice. Tune RateLimitIntervalSec= and RateLimitBurst= in journald.conf, or LogRateLimitIntervalSec= and LogRateLimitBurst= on the unit itself.
Four hundred servers each run the same systemd timer with OnCalendar=*-*-* 03:00:00, and every night they hit the same internal package mirror at once. Which [Timer] directives spread that load, and which one does not do what people expect?
basics
~20 sRandomizedDelaySec= is the spreader: it delays each trigger by a random amount between zero and the given span. AccuracySec= does not spread load across a fleet — it only widens the window in which systemd may fire a timer so it can batch wakeups on that one host.
You are asked to make in-house Linux services restart without refusing connections, and someone proposes putting every service behind a systemd socket unit. How would you decide where socket activation is the right tool and where it is not?
basics
~20 sSocket activation is a single-host tool with a source-code prerequisite: the daemon must accept passed descriptors. It suits on-demand and local services, but it does not do version skew, health gating or cross-host traffic shifting — which is what most restart requirements really need.
showing 31–35 of 35