mediumMultiple ChoiceObjective-mapped
XK0-006 Practice Question: A DevOps engineer is writing a unit file for a…
A DevOps engineer is writing a unit file for a systemd service that should start after the network-online.target. Which directive should be added to the [Unit] section?
⚠ Common exam trap
Many exam-takers confuse ordering directives ('After=', 'Before=') with dependency directives ('Requires=', 'Wants=', 'BindsTo='), assuming that 'Requires=' or 'Wants=' also imply ordering, which they do not without an explicit 'After='.
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
✓
After=network-online.target
The 'After=' directive in the [Unit] section of a systemd unit file specifies the ordering relationship, ensuring that the current service starts only after the named unit (network-online.target) has reached the 'active' state. This is the correct directive for controlling startup order without creating a dependency that would force the target to start if it is not already enabled.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Requires=network-online.target
Why it's wrong here
Requires ensures the target is active, but does not guarantee the service starts after it; ordering is needed.
- ✗
Wants=network-online.target
Why it's wrong here
Wants is a weak dependency; the service will start even if the target fails.
- ✗
BindsTo=network-online.target
Why it's wrong here
BindsTo ties the service lifecycle to the target, but ordering still requires After.
- ✓
After=network-online.target
Why this is correct
Correct. The After directive ensures the service starts after the specified target is reached.
Go deeper
Related to this question
Learn chapter
File Permissions and Ownership
Key term
Service
A service is a software component or system that performs a specific function and is available to be used by other programs or users over a network.
Key term
systemd
systemd is a system and service manager for Linux operating systems that initializes and manages processes, services, and system resources after the kernel boots.
About these practice questions
One of 979 original XK0-006 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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA 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 XK0-006 exam.