Use it when a service, mount or timer does not start, or to see what systemd manages.
Units
A systemd unit is anything systemd manages, named by type suffix: .service (daemon), .socket, .timer, .mount, .target (group), .path, .device and more. Units have state (active, inactive, failed) and can depend on each other.
1. systemctl list-units --failed — anything failed?
2. systemctl status <unit> — active state and last lines.
3. journalctl -u <unit> -b — full log.
4. systemctl cat <unit> — which file and drop-ins apply.
5. Fix, systemctl daemon-reload if files changed, then restart.
unit file loaded → dependencies resolved → unit started → active (or failed) → logged in the journal
For systemd & Services → Units, continue with the first unproven Topic check: Resolve the canonical unit name, suffix/type and instance if templated. If that boundary is healthy, advance to the adjacent check: Capture load state, fragment path, drop-ins and key properties. 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
Operational reference
Fast context before you go deeper.
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
unit name/type → fragment + drop-ins → manager load state → dependency/order edges → activation transaction → active/sub state → represented resource result
Healthy evidence: the intended canonical unit loads from expected sources with correct relationships and its represented resource reaches verified operational state.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Resolve the canonical unit name, suffix/type and instance if templated.
- Capture load state, fragment path, drop-ins and key properties.
- Inspect requirement and ordering relationships separately.
- Validate the resource or application represented by the unit after activation.
Verification chain. unit name/type → fragment + drop-ins → manager load state → dependency/order edges → activation transaction → active/sub state → represented resource result
Step 3 Specialized verification Verify boundary
Confirm the exact unit name and use the effective-unit view to see the loaded fragment and drop-ins. Inspect dependencies in the direction relevant to the problem, then examine current jobs and active/sub states. For template units, verify the concrete instance and its expanded parameters. If the unit represents a mount, timer or socket, verify the resource-specific outcome rather than stopping at the generic active state. Compare the on-disk override to the loaded manager state after daemon-reload.
Step 4 Commands Verify boundary
systemctl list-units
systemctl list-unit-files --type=service
Step 5 Failure modes and next checks Narrow the fault
Suspicious evidence: an alias, stale fragment, hidden drop-in or misunderstood dependency causes operators to act on a different effective unit than intended.
Unit metadata shows systemd representation and manager configuration, not successful activation or resource health.
Step 6 Special cases and limits Narrow the fault
Unit identity is not interchangeable with a process name. A target can be active without every optional wanted unit being healthy, and a service alias can obscure the canonical unit name. Ordering is not a health dependency, and dependency cycles can be introduced by seemingly reasonable Before/After edits. A unit file that parses does not show the referenced executable, user, path or dependency is valid at runtime. Keep unit model, job graph and resource outcome separate.
Step 7 Common mistakes Narrow the fault
- Confusing loaded/active state with enabled state.
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.
Unit files live in /usr/lib/systemd/system (packages), /etc/systemd/system (admin, wins) and /run. Override with drop-ins (systemctl edit <unit>) instead of editing package files.
systemctl status <unit>— state, main PID, recent log linessystemctl list-units --failed— failed unitsjournalctl -u <unit> -b— the unit's log since bootsystemctl cat <unit>— unit file plus drop-inssystemd-analyze verify <unit>— unit file errors
ReferenceWhat it is1 section · depth on demand
Core model
Resolve the fully qualified unit name and type, including aliases/templates/instances where relevant. Inspect load state, fragment path, drop-ins and dependency edges before acting. A unit being loaded only shows systemd parsed a definition; activation and workload behavior are separate things to check.
ReferenceImportant terms & boundaries6 sections · depth on demand
What this shows and what it does not
Unit metadata shows systemd representation and manager configuration, not successful activation or resource health.
In depth
Unit types and where unit files live
Everything systemd manages is a unit, and the suffix of its name says what kind. The systemd.unit(5) manual page lists the types: service, socket, device, mount, automount, swap, target, path, timer, slice and scope.
In system mode, unit files are read from /etc/systemd/system, /run/systemd/system and /usr/lib/systemd/system, among others. A file earlier in that list overrides one with the same name later in it.
Unit types
| Type | Represents | Example |
|---|---|---|
.service | A process or daemon | nginx.service |
.socket | A listening socket that starts a service on demand | sshd.socket |
.target | A group of units, a synchronisation point | multi-user.target |
.timer | A schedule that starts another unit | logrotate.timer |
.mount / .automount | A mount point (often generated from fstab) | srv-data.mount |
.path | Watches a file system path | cups.path |
.device | A kernel device exposed by udev | dev-sda.device |
.swap | A swap device or file | dev-zram0.swap |
.slice | A cgroup branch for resource control | user.slice |
.scope | Externally started processes (e.g. login sessions) | session-3.scope |
Directory precedence
| Directory | Who writes it | Precedence |
|---|---|---|
/etc/systemd/system | The administrator | Highest |
/run/systemd/system | Runtime and generators | Middle |
/usr/lib/systemd/system | Packages | Lowest |
Never edit files under /usr/lib, because package updates overwrite them. Use a drop-in in /etc, or copy the file there.
Masking
A unit symlinked to /dev/null, or left empty, has the load state "masked" and can't be started at all, not even as a dependency.
host$ systemctl list-unit-files --type=service --state=enabled --no-legend | head -4
host$ systemctl list-units --type=mount --no-legend
boot-efi.mount loaded active mounted /boot/efi
srv-data.mount loaded active mounted /srv/data
host$ systemd-escape --path /srv/data
srv-data
host$ systemctl show -p FragmentPath,DropInPaths,UnitFileState cron.service
host$ ls -l /etc/systemd/system/*.service | grep -- '-> /dev/null'
Unit names from paths
Mount, automount and swap units are named after their path, with / replaced by -. systemd-escape --path gives the exact name. This matters when you write dependencies such as RequiresMountsFor= or After=srv-data.mount.
Documented example, not captured output.
How it works at runtime
Units is part of systemd & Services → Units. Units are systemd objects representing manageable resources such as services, sockets, targets, mounts, timers and paths; unit type, load state, dependencies and activation semantics determine what systemd can coordinate.
Topic-specific state model. Units are systemd objects representing manageable resources such as services, sockets, targets, mounts, timers and paths; unit type, load state, dependencies and activation semantics determine what systemd can coordinate.
Interpretation rule. - Unit loaded ≠ unit active.
- Unit alias/name resolution ≠ same semantics as the canonical unit in every context.
- Dependency listed ≠ ordering relationship unless the appropriate ordering edge also exists.
- Unit active ≠ resource/application is functionally acceptable.
Specialized mechanics
A systemd unit is the manager’s named object for a service, socket, timer, mount, target, path, device or other managed resource. The unit name encodes type through its suffix and can participate in templating/instances, aliases and dependency graphs. Unit state includes load, active and substate dimensions, while jobs represent pending transitions. The same conceptual service can therefore involve several cooperating units, for example a .socket activating a .service or a .timer activating another unit.
Quick reference
systemd manages everything as units, identified by suffix:
| Type | Purpose |
|---|---|
.service | Daemons and one-shot tasks |
.socket | Socket activation |
.timer | Scheduled activation |
.target | Groups/synchronisation points |
.mount / .automount | Filesystems (generated from fstab) |
.path | Activation on file changes |
.slice / .scope | cgroup resource groups |
.device | Kernel devices (udev) |
systemctl list-units --type=service --state=running
systemctl list-unit-files --state=enabled
systemctl list-dependencies multi-user.target | head -30
Limits and how it fails
Primary failure point. Unit metadata shows systemd representation and manager configuration, not successful activation or resource health.
ReferenceConfiguration & state2 sections · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Units owns generic systemd unit-object semantics. Services, Targets, Timers and specific resource unit types own their specialized behavior.
Specialized lifecycle
Effective unit configuration is assembled from search-path precedence, the main fragment and drop-ins. Instance templates use escaped identifiers and % specifiers, so confirm the exact expanded unit name before editing. Dependency directives and ordering directives are orthogonal: Requires= can pull in a unit but does not itself establish startup order. Local customization should normally live in administrator drop-ins rather than modified vendor files so package upgrades remain visible and reversible.
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 → Units. 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: unit identity, load paths, dependencies and enablement semantics. 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/man5/systemd.unit.5.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
Units operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Units.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Units are systemd objects representing manageable resources such as services, sockets, targets, mounts, timers and paths; unit type, load state, dependencies and activation semantics determine what systemd can coordinate. | 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 | unit name/type → fragment + drop-ins → manager load state → dependency/order edges → activation transaction → active/sub state → represented resource result | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Unit metadata proves systemd representation and manager configuration, not successful activation or resource 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: unit name/type → fragment + drop-ins → manager load state → dependency/order edges → activation transaction → active/sub state → represented resource 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. Unit metadata proves systemd representation and manager configuration, not successful activation or resource 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. |
Units · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Units |
|---|---|
| Topic path | systemd & Services → Units |
| Runtime state | Units are systemd objects representing manageable resources such as services, sockets, targets, mounts, timers and paths; unit type, load state, dependencies and activation semantics determine what systemd can coordinate. |
| Fast checks | - Resolve the canonical unit name, suffix/type and instance if templated. - Capture load state, fragment path, drop-ins and key properties. - Inspect requirement and ordering relationships separately. - Validate the resource or application represented by the unit after activation. |
| Verification chain | unit name/type → fragment + drop-ins → manager load state → dependency/order edges → activation transaction → active/sub state → represented resource result Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | Unit metadata proves systemd representation and manager configuration, not successful activation or resource 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. |
Units · specialized operational reference
Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.
| Operational boundary | Topic-specific reference |
|---|---|
| Identity | Exact name, suffix and instance |
| Composition | Fragment + drop-ins + generators |
| Graph | Requirement relations separate from ordering |
| Proof | Loaded effective unit + resource-specific result |