LFCS Service Configuration Practice Question
A system administrator needs to configure a new systemd service unit file for a custom application. The service should start after the network is fully online and requires the /opt/data directory to be mounted. Which section of the unit file should contain the After= and Requires= directives to define these dependencies?
⚠ Common exam trap
The trap here is assuming that all directives related to a service go in the [Service] section, but dependency directives are unit-level and belong in [Unit].
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
[Unit]
Dependency and ordering directives such as After= and Requires= are placed in the [Unit] section because they describe the unit's relationships with other units and targets. The [Service] section is for execution parameters, [Install] for enabling, and [Path] for path units. Thus, [Unit] is correct.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
[Path]
Why it's wrong here
[Path] is used for path-based activation units (e.g., .path units) and specifies paths to monitor. It is not used in service unit files for defining dependencies; using it here would be invalid and cause systemd to ignore or reject the directives.
- ✗
[Install]
Why it's wrong here
The [Install] section defines how the unit is enabled or disabled, typically via WantedBy or RequiredBy. It does not contain dependency ordering or requirement directives like After= or Requires=, which are used to control startup order and dependencies.
- ✓
[Unit]
Why this is correct
The [Unit] section contains generic unit configuration options, including dependency ordering (After, Before) and requirement (Requires, Wants). Directives like After=network-online.target and RequiresMountsFor=/opt/data belong here because they define relationships with other units and mount points, not service execution parameters.
- ✗
[Service]
Why it's wrong here
The [Service] section holds service-specific execution parameters such as ExecStart, Restart, and User. While it can contain some dependency-related settings like RequiresMountsFor, the primary After= and Requires= directives are not placed here; they belong in [Unit] to define unit relationships.
Go deeper
Related to this question
About these practice questions
One of 406 original LFCS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint
This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.