Courseiva
Operate running systems →easyMultiple Choice

EX200 Operate running systems Practice Question

A critical service must restart automatically after a crash. Which systemd directive should be added to the [Service] section of the service unit file?

⚠ Common exam trap

It's easy for candidates to confuse dependency directives like `Requires=` or `Wants=` with restart behavior, but systemd separates dependency management from process supervision, so only `Restart=` controls automatic restart after a crash.

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=always

The `Restart=always` directive in the `[Service]` section of a systemd unit file instructs systemd to automatically restart the service whenever it exits, regardless of the exit status. This ensures the critical service recovers immediately after a crash without manual intervention, which is essential for high-availability requirements.

Answer analysis

Option-by-option breakdown

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

  • ✗

    OnFailure=

    Why it's wrong here

    OnFailure= is a unit dependency directive that specifies another unit to activate when the current unit enters a failed state. It does not cause the failed unit itself to be restarted; instead, it launches a separate designated unit (e.g., a notification or rescue service). To automatically restart the original service, you must set Restart= in the [Service] section, not rely on OnFailure=.

  • ✗

    Requires=

    Why it's wrong here

    Requires= declares a hard dependency: the listed unit must be active for this unit to start, and if the required unit stops or fails, this unit will be deactivated or stopped as well. This directive controls startup ordering and activation, not post-crash behavior. It does not monitor the service's process or schedule restarts; it simply enforces that dependencies remain satisfied at the time of start.

  • ✓

    Restart=always

    Why this is correct

    Restart=always is the correct systemd directive for automatically restarting a service after it exits, regardless of the exit status. Placed in the [Service] section, it tells systemd to unconditionally restart the process, covering crashes, normal exits, and signals. This provides a high degree of availability, though it may also restart after intentional stops; more granular control can be achieved with variants like Restart=on-failure.

  • ✗

    Wants=

    Why it's wrong here

    Wants= is a weak dependency directive: it attempts to start the specified unit when this unit starts, but if that unit fails, the current unit continues running normally. It is about startup activation and ordering, not about reacting to crashes or restarting the service. Unlike Restart=always, Wants= contains no logic to monitor the service's runtime status or issue automatic restarts.

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 →

How Courseiva writes practice questions · Editorial policy

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.