Courseiva
mediumMultiple Choice

XK0-006 Practice Question: Refer to the exhibit

Exhibit

[Unit]
Description=My custom service
After=network.target

[Service]
ExecStart=./myscript
Restart=always

[Install]
WantedBy=multi-user.target

Refer to the exhibit. A Linux administrator created a systemd service file for a custom script. When starting the service, it fails with 'Unit myservice.service entered failed state.' Which of the following is the most likely cause?

⚠ Common exam trap

CompTIA often tests the requirement for absolute paths in ExecStart, and the trap here is that candidates may assume relative paths are acceptable or that the [Install] section is mandatory for starting a service, when in fact it is only for enabling.

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

✓

The ExecStart path is relative

The most likely cause is that the ExecStart path is relative. Systemd requires absolute paths for ExecStart directives; a relative path (e.g., `./script.sh` or just `script.sh`) will cause the unit to fail immediately because systemd cannot resolve the executable location. The error 'entered failed state' typically results from this path resolution failure.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    The ExecStart path is relative

    Why this is correct

    systemd requires an absolute path in ExecStart; a relative path causes the unit to fail immediately with 'entered failed state', since systemd cannot resolve the executable. This directly matches the stem's symptom and the most likely cause.

  • ✗

    The service type should be forking

    Why it's wrong here

    Type=forking suits daemons that background themselves after a parent exits; a script running in the foreground with Type=simple is expected to stay in the foreground, so forking would make systemd misjudge startup. It is tempting for traditional daemonised services, which is when forking is genuinely required.

  • ✗

    The service file lacks an [Install] section

    Why it's wrong here

    The [Install] section governs enablement and boot-time symlinks, not execution, so its absence leaves manual start unaffected. It is tempting because omitting it prevents systemctl enable, and it would be the correct answer when a service starts fine but does not launch automatically at boot.

  • ✗

    The Requires directive is missing

    Why it's wrong here

    Requires only adds a dependency relationship; its absence does not itself cause a unit to enter failed state. It is tempting because missing dependencies do break units, and Requires would be correct when the service genuinely needs another unit active, such as a database, before starting.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every XK0-006 question from scratch — 781 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 →

How Courseiva writes practice questions · Editorial policy

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.