mediumMultiple Select
XK0-006 Practice Question: A system administrator is troubleshooting a…
A system administrator is troubleshooting a custom systemd service that fails to start. Which of the following commands should be used to diagnose the issue? (Choose two.)
⚠ Common exam trap
The trap here is that candidates often pick `systemctl daemon-reload` (A) thinking it will fix the issue by reloading unit files, but it does not provide diagnostic output; the exam tests the distinction between reloading configuration and retrieving failure logs.
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
✓
systemctl status myservice
Option B, systemctl status myservice, is correct because it displays the current state of the unit, including whether it is active, failed, or inactive, along with the most recent log lines and the exit code, which directly helps diagnose why the service failed to start. Option E, journalctl -u myservice, is correct because it queries the systemd journal for all log messages associated with that specific unit, providing detailed error output, stack traces, or dependency failures needed to pinpoint the root cause. Option A, systemctl daemon-reload, only reloads unit file definitions after edits and does not diagnose a failing service. Option C, systemctl enable myservice, merely creates symlinks for automatic startup at boot and does not reveal why the service fails. Option D, systemctl list-units, gives a broad overview of loaded units but lacks the per-unit detail and logs required for troubleshooting a specific failed service.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
systemctl daemon-reload
Why it's wrong here
daemon-reload only re-reads unit files after edits; it does not reveal why a service failed to start. It is tempting because it is routinely run after changing a unit file, and would be correct when systemd must pick up modified unit definitions before restarting the service.
- ✓
systemctl status myservice
Why this is correct
systemctl status myservice queries systemd directly, reporting the unit's load state, active state, and the most recent log lines, including the exit code that caused the failure. This satisfies the need to diagnose why the custom unit will not start.
- ✗
systemctl enable myservice
Why it's wrong here
enable only creates the symlink for start-at-boot; it neither starts the unit nor reports failure output, so it cannot diagnose the fault. It is tempting because enabling is a common step when configuring a new service, and would be correct when the service must start automatically at boot.
- ✗
systemctl list-units
Why it's wrong here
list-units shows loaded unit states, not the specific error output explaining a failed start. It is tempting because it gives a quick overview of active and failed units, and would be correct when confirming whether a unit is loaded or active rather than diagnosing its failure cause.
- ✓
journalctl -u myservice
Why this is correct
journalctl -u myservice reads the journal filtered to that unit, exposing the full startup sequence, dependency failures, and error output that systemctl status truncates. This satisfies the need for detailed diagnostic evidence behind the failed start.
Go deeper
Related to this question
Learn chapter
File Transfer and Remote Access
Key term
Dependency
A dependency is a piece of software, library, or package that another software application requires in order to function correctly.
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 781 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.