Courseiva
easyMultiple Select

XK0-006 Practice Question: A Linux administrator is writing a systemd…

A Linux administrator is writing a systemd service unit file. Which three of the following directives are valid in the [Service] section? (Select THREE.)

⚠ Common exam trap

CompTIA often tests the distinction between `[Unit]` and `[Service]` section directives, and the trap here is that candidates mistakenly apply dependency or ordering directives like `After` or `Requires` to the `[Service]` section, when they are only valid in `[Unit]`.

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

✓

Restart

Option A, Restart, is valid in the [Service] section and controls whether and how systemd restarts the service after it exits (e.g., Restart=on-failure). Option D, User, is valid in the [Service] section and specifies the UNIX user account under which the service process is executed. Option E, ExecStart, is valid in the [Service] section and defines the command line that systemd runs to start the service. Options B (After) and C (Requires) are not valid in [Service]; they are dependency/ordering directives that belong in the [Unit] section of the unit file.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Restart

    Why this is correct

    Restart is a valid [Service] directive controlling whether systemd restarts the unit after exit, with values such as always, on-failure or no. It belongs in the [Service] section alongside ExecStart and User, unlike [Unit] or [Install] directives.

  • ✗

    After

    Why it's wrong here

    After is a [Unit] section directive controlling start-up ordering relative to other units; systemd does not recognise it inside [Service]. It is tempting because ordering feels tied to how the service starts, yet After belongs with unit dependencies, not process execution settings.

  • ✗

    Requires

    Why it's wrong here

    Requires belongs in the [Unit] section, expressing a hard dependency on another unit; placing it in [Service] makes systemd ignore or reject it. It is tempting because dependency directives feel service-related, but Requires governs unit ordering and activation, not the service process itself.

  • ✓

    User

    Why this is correct

    User is a valid [Service] directive, setting the UNIX account the service process runs as, which drops privileges from root. It belongs in [Service], not [Unit] or [Install], satisfying the question's requirement for a valid directive.

  • ✓

    ExecStart

    Why this is correct

    ExecStart is a valid [Service] directive specifying the command systemd runs to start the unit. It is fundamental to service units and correctly placed in [Service], satisfying the question's requirement for a valid directive in that section.

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 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.