Courseiva
mediumMultiple SelectObjective-mapped

XK0-006 Practice Question: Ensure that a web service starts after the…

An administrator wants to ensure that a web service starts after the database service has fully initialized. Which TWO methods can be used to achieve this ordering dependency in systemd?

⚠ Common exam trap

The trap here is that candidates often pick only `After=` (option B) thinking it alone enforces the dependency, forgetting that `After=` only orders startup and does not prevent the web service from starting if the database fails — the exam expects the combination of `Requires=` and `After=` to fully satisfy the 'starts after and depends on' requirement.

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

Add Requires=db.service in the [Unit] section

`Requires=db.service` in the `[Unit]` section declares a strong dependency: if `db.service` fails to start, `web.service` will not be started. Option B is correct because `After=db.service` in the `[Unit]` section of `web.service` ensures that `web.service` starts only after `db.service` has reached the 'active' state, enforcing the required ordering. Together, these two directives guarantee both dependency and sequencing.

Answer analysis

Option-by-option breakdown

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

  • Add Requires=db.service in the [Unit] section

    Why this is correct

    Makes db.service a required dependency; together with After, it ensures ordering.

  • Add After=db.service in the [Unit] section of web.service

    Why this is correct

    Specifies that web.service should be started after db.service.

  • Add BindsTo=db.service in the [Unit] section

    Why it's wrong here

    BindsTo ties the lifecycle; stopping db stops web, but ordering is not guaranteed.

  • Add Wants=db.service in the [Unit] section

    Why it's wrong here

    Wants is a weak dependency; db.service may not start.

  • Add PartOf=db.service in the [Unit] section

    Why it's wrong here

    PartOf is used for stopping/restarting together, not ordering.

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 →

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.