Courseiva
System Management →mediumMultiple Choice

XK0-006 System Management Practice Question

An administrator notices that a service named 'httpd' is not running. They want to check its current status and, if inactive, start it. Which set of systemctl commands should be used?

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

✓

systemctl status httpd; if inactive, systemctl start httpd

systemctl status httpd shows the status; if inactive, systemctl start httpd starts it. The other options have incorrect commands or syntax.

Answer analysis

Option-by-option breakdown

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

  • ✗

    systemctl list-units httpd; if inactive, systemctl run httpd

    Why it's wrong here

    systemctl list-units only lists loaded units and cannot start anything; systemctl run is not a valid subcommand. Checking status and starting a unit requires systemctl status followed by systemctl start. list-units is genuinely useful for enumerating all active units when diagnosing broadly, but not for querying or starting one named service.

  • ✗

    systemctl show httpd; if inactive, systemctl launch httpd

    Why it's wrong here

    systemctl show displays properties rather than active state, and systemctl launch is not a valid subcommand, so the sequence fails. It tempts because show sounds like status and launch sounds like start, and would be correct only if replaced with systemctl status httpd and systemctl start httpd.

  • ✗

    systemctl is-active httpd; if inactive, systemctl enable httpd

    Why it's wrong here

    systemctl enable only configures the unit to start at boot; it does not start httpd now, so the service stays inactive. The stem requires immediate activation. enable is the right command when the goal is persistence across reboots, not bringing a currently stopped service up in the running session.

  • ✓

    systemctl status httpd; if inactive, systemctl start httpd

    Why this is correct

    systemctl status httpd reports whether the unit is active, inactive or failed, and systemctl start httpd launches it if inactive. This pairing satisfies the requirement to check current state before conditionally starting the service, using systemd's native unit management.

About these practice questions

One of 781 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.