Use it when a service starts before what it needs (network, database, mount) is ready.
Service Dependencies
Service dependencies tell systemd what must also start (Wants=, Requires=) and in which order (After=, Before=). They are separate: Requires= without After= starts both at the same time.
1. systemctl list-dependencies <svc> — what it pulls in.
2. systemctl show <svc> -p After -p Wants -p Requires — ordering and requirements.
3. systemd-analyze critical-chain <svc> — what it waited for.
4. Add the missing After=/Wants= in a drop-in (systemctl edit <svc>).
5. Reboot or restart and confirm the order in the journal.
unit requested → Wants/Requires add other units → After/Before order them → units start in order
For systemd & Services → Service Dependencies, continue with the first unproven Topic check: Capture effective Requires/Wants/BindsTo and Before/After properties from the manager. If that boundary is healthy, advance to the adjacent check: Trace the transaction to the first failed, skipped or timeout boundary. 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
effective unit definitions → requirement edges + ordering edges → transaction construction → prerequisite job outcomes → dependent activation → application dependency readiness → workload result
Healthy evidence: effective requirement and ordering edges match intent, prerequisite jobs complete in the needed sequence and downstream workload readiness is verified.
Step 2 Verify unit state and service readiness separately Verify boundary
After correcting a relationship or unit file, reload the manager only when definitions changed, then start or restart the smallest affected unit set. Confirm the expected requirement and ordering edges are present in the effective graph, verify dependent units are active, and then perform each service’s readiness check rather than stopping at ActiveState=active. Finally repeat the original consumer operation from the same identity, namespace and network context. If the fix involved boot ordering, also validate the next boot path because a manually started service can succeed even when the boot transaction still contains an ordering or dependency flaw.
Step 3 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Capture effective Requires/Wants/BindsTo and Before/After properties from the manager.
- Trace the transaction to the first failed, skipped or timeout boundary.
- Check whether the upstream unit’s activation semantics actually represent readiness needed by the dependent workload.
- Retest the original dependent service after the smallest graph/readiness correction.
Verification chain. effective unit definitions → requirement edges + ordering edges → transaction construction → prerequisite job outcomes → dependent activation → application dependency readiness → workload result
Step 4 Commands Verify boundary
systemctl list-dependencies app
systemctl show app -p Requires,Wants,After
Step 5 Trace the unit transaction and the first failed dependency Narrow the fault
When a service does not start, distinguish a missing dependency, a failed dependency, an ordering cycle, a timeout and an application process that started but never became usable. Inspect the effective unit with its drop-ins, then inspect dependency and reverse-dependency relationships. Follow the first failed unit in the transaction and read its journal in the same boot. If every dependency is active but the consumer still fails, move beyond systemd and test the dependency’s actual socket, file, mount, network or API contract. Restarting the top-level service repeatedly can hide the boundary and reset useful failure state; collect the dependency graph and failure timestamps first.
Step 6 Failure modes and next checks Narrow the fault
Suspicious evidence: After= is used as a readiness/dependency fix or a loaded drop-in silently changes the graph operators think they configured.
systemd dependency evidence shows manager-level relationship and ordering semantics, not that an upstream application is semantically ready for consumers.
Step 7 Common mistakes Narrow the fault
Wants=withoutAfter=, so order is not guaranteed.
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.
Use After=network-online.target plus Wants=network-online.target for services that need a configured network. Use RequiresMountsFor=<path> for data on a mount. Prefer Wants= over Requires= unless the service truly cannot run without the other.
systemd-analyze critical-chain <unit>— what the unit waited forsystemctl 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
Build the effective dependency graph from loaded units and drop-ins, then classify each edge as requirement, ordering or propagation behavior. Diagnose the first unit/job that failed or was skipped. Adding After= only changes ordering; it does not create a requirement or wait for application-level readiness beyond systemd activation semantics.
ReferenceHow it works1 section · depth on demand
Requirement relationships are not the same as ordering
systemd models two different ideas that are often confused: whether another unit is required or wanted, and when units are ordered relative to one another. Requires= and Wants= pull units into the transaction with different failure semantics, while After= and Before= only define ordering when both units are part of the transaction. An After= relationship does not start the referenced unit by itself, and Requires= does not automatically mean “start only after this service is ready.” Readiness may depend on Type=, notification behavior, sockets or an application-specific health condition. Drop-ins and generated units can change the effective graph, so diagnose the loaded unit definition and transaction rather than only the vendor unit file on disk.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
systemd dependency evidence shows manager-level relationship and ordering semantics, not that an upstream application is semantically ready for consumers.
In depth
Service dependencies: requirements and ordering
systemd keeps two kinds of relationships between units, and mixing them up is a classic error. Requirements (Wants=, Requires=, BindsTo=) decide which units are started together. Ordering (After=, Before=) decides in which sequence. The systemd.unit(5) manual page states explicitly that requirement dependencies don't influence the start order. Without After=, a unit and the units it requires start in parallel.
Requirement keywords (manual)
| Keyword | Effect |
|---|---|
Wants= | Start the other unit too; continue even if it fails (the recommended default) |
Requires= | Stronger; if the other unit is explicitly stopped or restarted, this one follows |
Requisite= | The other unit must already be active, otherwise the start fails immediately |
BindsTo= | Like Requires=, and also stop when the other unit stops unexpectedly |
PartOf= | Only stop and restart propagate, one way |
Upholds= | Keep restarting the other unit whenever it isn't active |
Conflicts= | Starting one stops the other |
Ordering
After=b means "start after b, and stop before b". Stop order is the reverse of start order.
Typical combinations
| Need | Configuration |
|---|---|
| App needs its local database at start-up | Wants=postgresql.service + After=postgresql.service |
| App must stop when its tunnel drops | BindsTo=wg-quick@wg0.service + After=wg-quick@wg0.service |
| A helper restarts together with the main service | PartOf=main.service in the helper |
| Needs a mounted path | RequiresMountsFor=/srv/data (adds both requirement and ordering) |
host$ sudo systemctl edit report-api
[Unit]
Wants=postgresql.service
After=postgresql.service
RequiresMountsFor=/srv/reports
host$ systemctl list-dependencies report-api --no-pager
host$ systemctl show report-api -p Wants,Requires,After,BindsTo
host$ systemd-analyze critical-chain report-api.service
report-api.service +312ms
└─postgresql.service @4.102s +1.204s
└─network-online.target @4.090s
host$ systemd-analyze verify /etc/systemd/system/report-api.service
Reading critical-chain
The output shows the chain of ordering dependencies that delayed this unit, and how long each took. @ is when the unit became active, and + is how long it took to start. It's the fastest way to see why a service starts late at boot.
Documented example, not captured output.
How it works at runtime
Service Dependencies is part of systemd & Services → Service Dependencies. Service Dependencies in systemd are separate requirement and ordering relationships that shape transactions: Wants=/Requires=/BindsTo= express forms of requirement, while Before=/After= express ordering, and these dimensions must not be conflated.
Topic-specific state model. Service Dependencies in systemd are separate requirement and ordering relationships that shape transactions: Wants=/Requires=/BindsTo= express forms of requirement, while Before=/After= express ordering, and these dimensions must not be conflated.
Interpretation rule. - After= ≠ dependency requirement.
- Requires= ≠ application readiness guarantee.
- Wants= failure ≠ necessarily failure of the wanting unit.
- Dependency graph on disk ≠ effective loaded graph when drop-ins/generated units modify it.
Quick reference
Dependencies have two independent dimensions:
| Directive | Effect |
|---|---|
Wants= | Start the other unit too (weak) |
Requires= | Start it; stop us if it stops/fails |
BindsTo= | Like Requires, stricter (also stop if it disappears) |
PartOf= | Restart/stop propagates from the other unit |
After= / Before= | Ordering only — no activation |
Conflicts= | Cannot run together |
Common mistake: After=network-online.target without Wants=network-online.target — ordering alone does not pull the target in.
systemctl list-dependencies app.service
systemd-analyze critical-chain app.service
Limits and how it fails
Primary failure point. systemd dependency evidence shows manager-level relationship and ordering semantics, not that an upstream application is semantically ready for consumers.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Service Dependencies owns systemd transaction relationships. Application-level dependency protocols and health semantics remain in their service/domain branches.
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 → Service Dependencies. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://systemd.io/ · confidence 94%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
Service Dependencies operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Service Dependencies.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Service Dependencies in systemd are separate requirement and ordering relationships that shape transactions: Wants=/Requires=/BindsTo= express forms of requirement, while Before=/After= express ordering, and these dimensions must not be conflated. | 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 | effective unit definitions → requirement edges + ordering edges → transaction construction → prerequisite job outcomes → dependent activation → application dependency readiness → workload result | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | systemd dependency evidence proves manager-level relationship and ordering semantics, not that an upstream application is semantically ready for consumers. | 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: effective unit definitions → requirement edges + ordering edges → transaction construction → prerequisite job outcomes → dependent activation → application dependency readiness → workload 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 dependency evidence proves manager-level relationship and ordering semantics, not that an upstream application is semantically ready for consumers. | 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. |
Service Dependencies · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Service Dependencies |
|---|---|
| Topic path | systemd & Services → Service Dependencies |
| Runtime state | Service Dependencies in systemd are separate requirement and ordering relationships that shape transactions: Wants=/Requires=/BindsTo= express forms of requirement, while Before=/After= express ordering, and these dimensions must not be conflated. |
| Fast checks | - Capture effective Requires/Wants/BindsTo and Before/After properties from the manager. - Trace the transaction to the first failed, skipped or timeout boundary. - Check whether the upstream unit’s activation semantics actually represent readiness needed by the dependent workload. - Retest the original dependent service after the smallest graph/readiness correction. |
| Verification chain | effective unit definitions → requirement edges + ordering edges → transaction construction → prerequisite job outcomes → dependent activation → application dependency readiness → workload result Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | systemd dependency evidence proves manager-level relationship and ordering semantics, not that an upstream application is semantically ready for consumers. 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. |