hardMultiple ChoiceObjective-mapped
XK0-006 Practice Question: Based on the exhibit, the service has failed
Exhibit
Refer to the exhibit. ``` $ systemctl status myservice.service ● myservice.service - My Custom Service Loaded: loaded (/etc/systemd/system/myservice.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2024-03-11 14:23:45 UTC; 3min ago Process: 12345 ExecStart=/usr/local/bin/myservice.sh (code=exited, status=1/FAILURE) Main PID: 12345 (code=exited, status=1) CGroup: /system.slice/myservice.service ```
Based on the exhibit, the service has failed. Which of the following is the most appropriate first step to diagnose the cause of the failure?
⚠ Common exam trap
The trap here is that candidates often jump to checking logs (journalctl) or restarting the service, but the most efficient first step is to test the underlying script directly, as logs may not capture the exact error if the script fails before producing output.
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
✓
Check the script /usr/local/bin/myservice.sh for errors and run it manually
The exhibit indicates the service has failed, and the most appropriate first step is to check the script referenced in the unit file for errors and run it manually. This directly tests the executable that systemd is trying to run, isolating whether the failure is due to a script bug, missing dependencies, or permission issues, rather than assuming the service configuration or logs are the problem.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Check if the service is a timer and was triggered
Why it's wrong here
Not relevant; the service failed to start.
- ✓
Check the script /usr/local/bin/myservice.sh for errors and run it manually
Why this is correct
Directly diagnose the script's failure.
- ✗
Run systemctl daemon-reload to reload unit files
Why it's wrong here
Daemon reload is for unit file changes, not for diagnosing failures.
- ✗
Restart the service using systemctl restart myservice.service
Why it's wrong here
Likely to fail again without diagnosis.
- ✗
Run journalctl -u myservice.service to view logs
Why it's wrong here
Logs may show output, but running the script manually is more direct.
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
Courseiva writes every XK0-006 question from scratch — 979 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.