Courseiva

XK0-006 Automation, Orchestration, and Scripting Practice Question

A Linux administrator is writing a systemd unit file at /etc/systemd/system/backup.service that must execute /usr/local/bin/backup.sh only after the network is fully reachable and the /mnt/archive mount is active. The unit currently has no ordering directives. Which directive should be added to the [Unit] section to satisfy this requirement?

⚠ Common exam trap

The trap here is assuming that Requires= or Wants= also controls start order, when systemd keeps dependency and ordering semantics completely separate.

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 local-fs.target

Ordering in systemd is expressed with After= and Before=, which control when a unit is queued relative to others without creating a dependency. To guarantee the backup script runs only once the network is up and /mnt/archive is mounted, the [Unit] section needs After=network-online.target local-fs.target. Dependency keywords such as Requires, Wants, and BindsTo pull units in or tie lifecycles together but never enforce start ordering on their own.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Wants=network-online.target local-fs.target

    Why it's wrong here

    Wants= is a weak dependency that causes the listed units to be started alongside backup.service, but it imposes no ordering whatsoever. The script could therefore execute while the network stack or the /mnt/archive mount is still being brought up, which fails the requirement that the unit run only after both are active.

  • ✗

    Requires=network-online.target local-fs.target

    Why it's wrong here

    Requires= creates a hard dependency that pulls the listed units in and stops backup.service if they are explicitly stopped, but it does not order activation. Without After=, systemd may start backup.service concurrently with network-online.target, so the script could run before /mnt/archive is mounted, failing the stated timing requirement.

  • ✓

    After=network-online.target local-fs.target

    Why this is correct

    After= establishes ordering only: backup.service is queued to start after the listed targets finish activating, so the network is reachable and local filesystems including /mnt/archive are mounted first. This is exactly the ordering guarantee the scenario demands, and systemd will not begin the unit until those targets are active.

  • ✗

    BindsTo=network-online.target local-fs.target

    Why it's wrong here

    BindsTo= is a strong dependency that stops backup.service when any listed unit stops, but like other dependency directives it does not by itself sequence startup. The administrator still needs explicit ordering, and BindsTo could additionally tear down the backup job if the mount is intentionally stopped later.

About these practice questions

This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

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.