EX200 Operate running systems Practice Question
Which command checks if a specific systemd service is currently running?
⚠ Common exam trap
Candidates often confuse `systemctl status` with `systemctl is-active`. While `systemctl status` displays detailed information including whether the service is running, it does not return a simple exit code for scripting. The question specifically asks for a command that *checks* if a service is currently running, which `systemctl is-active` does via its exit code, making it the correct choice for automation and direct status queries in Red Hat Enterprise Linux.
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 is-active
The `systemctl is-active` command is specifically designed to check whether a systemd service is currently in the 'active' (running) state. It returns an exit code of 0 if the service is active, and a non-zero exit code otherwise, making it ideal for scripting and direct status checks.
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 is-active
Why this is correct
systemctl is-active directly queries the systemd manager over the D-Bus interface for the unit's current runtime state and prints a single word such as 'active', 'inactive', 'activating', or 'failed'. Its exit code is also set to 0 only when the service is active, making it the ideal tool for shell conditionals and monitoring scripts because it requires no output parsing or filtering.
- ✗
systemctl status
Why it's wrong here
systemctl status is a diagnostic command that produces a detailed, human-readable snapshot of a unit, including the active state, main PID, memory usage, recent journal logs, and cgroup hierarchy. While the active state does appear in this output, status is not meant for programmatic checks; using it for that purpose forces you to parse multi-line text and extract the relevant state line, which is brittle and unnecessary when a dedicated check command exists.
- ✗
systemctl list-units
Why it's wrong here
systemctl list-units enumerates all loaded units and displays them in a table with columns for UNIT, LOAD, ACTIVE, SUB, and DESCRIPTION. To determine whether a single service is active this way, you would need to run the entire list, filter for the exact unit name, and then parse the ACTIVE column, which is indirect and unreliable because output can be truncated in narrow terminals or exclude inactive units unless --all is given. It answers the question of what units are loaded, not whether one specific unit is currently active.
- ✗
systemctl show
Why it's wrong here
systemctl show exposes the complete set of systemd unit properties as key-value pairs, including ActiveState, SubState, ExecMainPID, and many other configuration and runtime fields. While you can extract the ActiveState property using -p ActiveState, this command is designed for retrieving detailed property data, not for a quick, simple check; invoking it pulls a large amount of information and requires additional parsing to isolate the state, making it an unnecessarily heavy approach compared to systemctl is-active.
Go deeper
Related to this question
About these practice questions
This EX200 question is part of Courseiva's 427-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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This EX200 practice question is part of Courseiva's free Red Hat 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 EX200 exam.