Use it when the simple commands mislead: a unit that is "running" and does nothing, a change with no effect, a service that starts too early or will not stay down.
systemd
systemd is the first process on a Linux system (PID 1) and the manager of everything after it: it reads unit files, works out start order, launches services and supervises each in its own control group.
1. systemctl cat <unit> — is the setting you expect actually in effect?
2. Not → a drop-in or a file in /etc/systemd/system overrides it; or daemon-reload is missing.
3. systemctl show <unit> -p NRestarts,ExecMainStatus — restarting? Exit code?
4. "Start request repeated too quickly" → fix the cause, then systemctl reset-failed <unit>.
5. Starts before its dependency is ready → add After= and Wants= in a drop-in.
unit files read (etc over run over usr/lib, plus drop-ins) → daemon-reload → dependency and order graph → start job → readiness according to Type= → supervised in a control group → restarted per Restart=
For systemd & Services → systemd, continue with the first unproven Topic check: Confirm the host/container manager context and exact unit scope. If that boundary is healthy, advance to the adjacent check: Inspect manager-reported unit load/active/sub state and relevant transaction result. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
- "Active (running) means the service works." It means a process exists. Test the service itself — its port, its response.
- "Enabled means running." Enabled only means it will be started at boot.
- "I edited the unit file, so the change applies." Not until
systemctl daemon-reloadand a restart. - "
After=makes the other unit start." It only orders;Wants=orRequires=pulls the unit in. - "The unit file in
/usr/libis what runs." A file or drop-in under/etc/systemd/systemmay override it; check withsystemctl cat. - "The service is failed, so start it again." Read
systemctl statusand the journal first; after repeated failures it also needssystemctl reset-failed. - "Killing the main process stops the service." With
Restart=set, systemd starts it again.
Operational reference
Fast context before you go deeper.
systemctl status <unit>Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
systemd manager context → unit load → dependency transaction → activation job → cgroup/process supervision → active/sub state → readiness → consumer result
Healthy evidence: the manager has the intended effective unit configuration, transaction completes, supervised processes match intent and the service passes its acceptance test.
Step 2 Operational verification Verify boundary
Unit state, dependencies, start/stop/restart behavior, enablement and systemd troubleshooting.
Fast verification
- Inspect
systemctl status,systemctl showandsystemctl catfor effective unit state and configuration.
- Use systemctl list-dependencies when ordering or dependency failures are suspected.
- Read the unit journal before editing override files; daemon-reload is required after unit definition changes.
Step 3 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Confirm the host/container manager context and exact unit scope.
- Inspect manager-reported unit load/active/sub state and relevant transaction result.
- Compare loaded properties/drop-ins with files on disk when configuration changed.
- Verify application readiness and dependent workload separately from systemd state.
Verification chain. systemd manager context → unit load → dependency transaction → activation job → cgroup/process supervision → active/sub state → readiness → consumer result
Step 4 Specialized verification Verify boundary
Inspect the unit’s load state, active/sub state, fragment/drop-in paths and cgroup/MainPID. Use the effective unit view to show which configuration systemd loaded, then correlate job/dependency state and journal records to the transition. For service correctness, continue beyond “active” to the application’s listener, readiness or original workload. After a unit-file edit, verify that daemon-reload occurred and that the relevant restart/reload transition actually consumed the new service configuration.
Step 5 Commands Verify boundary
systemctl --version
systemctl list-units --type=service --state=running
Step 6 Common mistakes Narrow the fault
- Using SysV init scripts on systemd systems.
Step 7 Failure modes and next checks Narrow the fault
Suspicious evidence: PID 1 or active state is treated as sufficient evidence while the service is not ready or loaded configuration is stale.
systemd evidence establishes manager decisions and supervised state, not complete application correctness or external dependency health.
Step 8 Special cases and limits Narrow the fault
systemd can successfully supervise a process that is functionally unhealthy, and a failed unit can reflect an application exit rather than a PID 1 defect. Unit dependencies express manager relationships, not necessarily application-level dependencies. A process outside the expected unit cgroup may indicate manual launch or delegation. Do not infer persistence from current active state or current success from enablement. Separate manager configuration, unit lifecycle, process state and workload behavior.
Step 9 Where it fails Narrow the fault
Walk persistent unit/config/generator → dependency/order graph → systemd state → process/cgroup → socket/resource dependency → journal → consumer check and stop where observed state diverges.
Also consider stale generated config, wrong environment, wrong namespace/chroot/container, package/provider mismatch, dependency ordering, immutable/read-only mounts, exhausted inode/block resources, capabilities, SELinux/AppArmor denial, systemd sandboxing, cgroup limits and boot-time state that differs from the interactive shell.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
A unit in /etc/systemd/system or a drop-in overrides the packaged one. With the default Type=simple, "started" only means the process was launched. After= orders; Wants=/Requires= pulls a unit in. A service that fails repeatedly hits a start limit.
systemctl cat <unit>— the effective unit with all drop-ins.systemctl show <unit> -p Type,Restart,ExecMainStatus,NRestarts— key properties.systemctl list-dependencies <unit>— what it pulls in.systemd-analyze verify <unit file>— syntax and reference errors.systemd-analyze critical-chain <unit>— what it waited for at boot.
ReferenceWhat it is2 sections · depth on demand
Core model
Treat systemd as a manager with its own loaded configuration and runtime state. Identify manager version/context, the exact unit transaction, dependency graph and cgroup/process outcome. PID 1 being alive shows the manager exists, not that a specific unit or workload is healthy.
Mental model
systemd is the first process started by the Linux kernel (PID 1) and the manager of everything that runs after it. It reads unit files, works out the order in which things must start, launches them in parallel where possible, and supervises each service in its own control group.
ReferenceWhy it matters3 sections · depth on demand
When to use it
Use this Topic when the problem is in systemd. Use System & Service Management when the problem concerns Linux runtime, services, networking, identity, packages, storage or shell automation.
Why it matters operationally
Understanding how systemd itself decides — which unit file wins, what "active" really means, how a service's start-up type affects what systemd believes — explains the cases where the simple commands mislead: a service reported as running that does nothing, a change that has no effect, a unit that starts too early.
Quality lift: concrete internals
systemd quality lift — inspect the concrete systemd unit and service lifecycle mechanics rather than treating existing coverage as completion. systemd resolves unit files/drop-ins, dependencies/order, conditions and environment, then forks/execs or activates the service and tracks its main process/readiness according to Type.
ReferenceHow it works1 section · depth on demand
How it works
Unit types. .service (a process), .socket (a listening socket that starts its service on demand), .timer (scheduled activation, the modern cron), .mount and .automount, .target (a named group or milestone), .path (start when a file changes) and .slice (a resource group).
Where unit files come from, highest priority first:
| Location | Purpose |
|---|---|
/etc/systemd/system | The administrator's units and overrides |
/run/systemd/system | Runtime units, gone at reboot |
/usr/lib/systemd/system | Units shipped by packages |
A file in /etc with the same name replaces the packaged one entirely. A drop-in — /etc/systemd/system/<unit>.d/*.conf — changes single settings and is the better tool. systemctl cat <unit> shows the effective result.
States. Each unit has a load state (was the file read successfully), an active state (active, inactive, failed, activating) and a sub-state (running, exited, dead…). "Active (exited)" is normal for a one-shot unit that did its job.
How systemd knows a service is up depends on Type=:
| Type | Considered started when |
|---|---|
simple (default) | The process has been launched — nothing more |
forking | The initial process has exited, leaving a daemon behind |
notify | The service tells systemd it is ready |
oneshot | The command has finished |
With simple, "active (running)" only means the process exists; it may still be initialising or stuck.
Supervision. Every service runs in its own control group, so systemd knows all its processes and can stop them all. Restart=on-failure makes systemd start a service again when it exits abnormally; a service that keeps failing hits a start limit and stays down until reset with systemctl reset-failed.
Loading changes. systemd holds unit files in memory. After any edit, systemctl daemon-reload makes it re-read them; running services keep their old settings until restarted.
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
systemd evidence establishes manager decisions and supervised state, not complete application correctness or external dependency health.
In depth
systemd as PID 1
When systemd runs as the first process at boot, it's the init system: it starts and supervises everything in userspace. The systemd(1) manual page describes the core concepts:
- Units: services, sockets, mounts, timers and more.
- States: active, inactive, failed, activating, deactivating, reloading, plus maintenance and refreshing.
- cgroups: systemd places every process in a control group named after its unit. It always knows which processes belong to which service, even after daemons fork.
The kernel command line can choose another target. systemd.unit=rescue.target, or the shortcuts rescue, single and 1, boot into rescue mode. emergency boots into emergency mode, and 3 is equivalent to multi-user.target.
Unit states (manual)
| State | Meaning |
|---|---|
| active | Started (or bound, plugged, mounted, depending on the unit type) |
| inactive | Stopped |
| failed | Stopped after a failure: non-zero exit, crash, timeout or too many restarts |
| activating / deactivating | In transition |
| reloading | Active and reloading its configuration |
What systemd replaces
| Older mechanism | systemd equivalent |
|---|---|
SysV init scripts in /etc/init.d | Service units |
| Runlevels | Targets |
| cron (partly) | Timer units |
| inetd | Socket units |
/etc/fstab handling at boot | Mount units generated from fstab |
| Separate log daemons | journald (often alongside rsyslog) |
Inspecting processes by unit
host$ systemctl status sshd --no-pager | sed -n '1,4p;/CGroup/,$p'
host$ systemd-cgls --no-pager -u nginx.service
Unit nginx.service (/system.slice/nginx.service):
├─1203 "nginx: master process /usr/sbin/nginx"
├─1204 "nginx: worker process"
└─1205 "nginx: worker process"
host$ ps -eo pid,user,cgroup:40,args | grep -m3 nginx
host$ systemd-analyze blame | head -5
host$ systemctl list-jobs
Re-executing the manager
The manual notes that SIGTERM to systemd as the system manager makes it serialise its state, re-execute itself and restore that state. That's mostly equivalent to systemctl daemon-reexec, which package upgrades of systemd itself use. A plain daemon-reload only re-reads unit files.
Documented example, not captured output.
How it works at runtime
systemd is part of systemd & Services → systemd. systemd is the Linux system and service manager commonly running as PID 1, responsible for unit loading, dependency transactions, service supervision, sockets/timers, cgroup placement and lifecycle coordination.
Runtime state ownership and mechanics. Processes have PID/TID identity, parentage, credentials, namespaces, cgroups, open files, memory mappings, scheduling state and signal disposition. systemd adds unit state, dependency ordering, cgroup ownership, restart policy and activation semantics above the raw process model.
Topic-specific state model. systemd is the Linux system and service manager commonly running as PID 1, responsible for unit loading, dependency transactions, service supervision, sockets/timers, cgroup placement and lifecycle coordination.
Technical metadata. Host/container, boot/session context, timestamp, PID namespace, PID/PPID + start time, executable/cmdline, process state, credentials, cgroup, canonical unit name/type, fragment path + drop-ins, load/unit-file state, requirement and ordering edges, systemd job result, MainPID/control process, active/sub/result state, journal correlation, readiness probe, original workload result.
Interpretation rule. - systemd PID 1 alive ≠ every managed unit is healthy.
- Manager job accepted ≠ service initialization completed successfully.
- On-disk unit definition ≠ currently loaded manager definition.
- Service process exists ≠ service contract is ready.
Specialized mechanics
systemd as PID 1 manages units, jobs, dependency ordering, cgroups and activation sources. The manager’s loaded unit model is distinct from the files currently present on disk, and a unit’s “active” state is distinct from application readiness. Jobs transition units according to dependency and ordering rules while cgroups provide process ownership that survives simple PID-parent assumptions. Socket, path, timer and device activation can start services indirectly, so the process that appears later may be the result of another unit’s activation semantics.
Mechanics
Follow the path in order: persistent unit/config/generator → dependency/order graph → systemd state → process/cgroup → socket/resource dependency → journal → consumer check.
Limits and how it fails
Primary failure point. systemd evidence establishes manager decisions and supervised state, not complete application correctness or external dependency health.
Model. PID existence does not show health, and a dead MainPID can be expected for oneshot units. “enabled” does not mean running, “active” does not mean enabled, and daemon-reload does not apply daemon configuration. systemd dependency ordering is not necessarily a readiness guarantee unless the service protocol/unit design provides one.
ReferenceConfiguration & state3 sections · depth on demand
Configuration, persistence and lifecycle
Configuration intent and lifecycle. For systemd-managed workloads, the unit plus drop-ins and generators form persistent intent; daemon-specific configuration remains a separate layer. enablement controls boot/target linkage and is distinct from current active state. daemon-reload refreshes systemd’s unit model but does not restart services.
Specialized lifecycle
Vendor unit files, administrator overrides, drop-ins, aliases, presets and generators participate in the effective configuration. Prefer drop-ins under /etc for local changes and use daemon-reload when unit files or generated unit metadata must be re-read. daemon-reload does not restart services; enablement does not start a unit; restart is not the same as reload. Before altering dependencies, distinguish requirement relationships from ordering because Wants/Requires and After/Before solve different problems.
Lifecycle
systemd generators and drop-ins, package scripts, udev, mount helpers, netlink, resolver caches, namespaces, SELinux/AppArmor policy and kernel drivers can make runtime state differ from the file or command that appears to own it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in systemd & Services → systemd. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://systemd.io/ · confidence 94%Authoritative Linux project/vendor documentation reviewed for bounded reference claims: PID 1 manager role, unit lifecycle and boot/service ownership. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.
Basis: https://man7.org/linux/man-pages/man1/systemd.1.html · confidence 93%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
systemd operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for systemd.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | systemd is the Linux system and service manager commonly running as PID 1, responsible for unit loading, dependency transactions, service supervision, sockets/timers, cgroup placement and lifecycle coordination. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin host/container + timestamp → identify exact process or unit → capture PID plus start identity and cgroup/unit → resolve effective unit fragment + drop-ins → inspect dependency/order transaction → record systemd job result → verify process/cgroup and active/sub state → prove application readiness → repeat the original workload test. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | systemd manager context → unit load → dependency transaction → activation job → cgroup/process supervision → active/sub state → readiness → consumer result | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | systemd evidence establishes manager decisions and supervised state, not complete application correctness or external dependency health. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux process/systemd evidence can establish this proof path: systemd manager context → unit load → dependency transaction → activation job → cgroup/process supervision → active/sub state → readiness → consumer result | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured process, manager, unit, dependency, runtime or application scope. systemd evidence establishes manager decisions and supervised state, not complete application correctness or external dependency health. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven boundary: reacquire stable process identity, inspect effective loaded unit configuration and dependency/job state, correlate process/cgroup plus journal evidence, then run the original readiness/workload test before changing additional settings. | Continue to the next unresolved boundary while preserving the original test condition. |
systemd · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | systemd |
|---|---|
| Topic path | systemd & Services → systemd |
| Runtime state | systemd is the Linux system and service manager commonly running as PID 1, responsible for unit loading, dependency transactions, service supervision, sockets/timers, cgroup placement and lifecycle coordination. |
| Fast checks | - Confirm the host/container manager context and exact unit scope. - Inspect manager-reported unit load/active/sub state and relevant transaction result. - Compare loaded properties/drop-ins with files on disk when configuration changed. - Verify application readiness and dependent workload separately from systemd state. |
| Verification chain | systemd manager context → unit load → dependency transaction → activation job → cgroup/process supervision → active/sub state → readiness → consumer result Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | systemd evidence establishes manager decisions and supervised state, not complete application correctness or external dependency health. Boundary chain: unit config/drop-ins → dependency/order/condition → exec/process → readiness/active state → owned socket/file/device → dependent client/workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |
systemd · specialized operational reference
Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.
| Operational boundary | Topic-specific reference |
|---|---|
| Manager state | Loaded unit model + jobs + cgroups |
| Persistent intent | Vendor file + /etc drop-ins + enablement links |
| Reload boundary | daemon-reload refreshes units; service reload/restart is separate |
| Proof | Unit/cgroup state plus application-visible success |