hardMultiple ChoiceObjective-mapped
XK0-006 Practice Question: A Linux server runs a critical service managed by…
A Linux server runs a critical service managed by a systemd service unit. The administrator needs to configure the service to automatically restart if it crashes, but only up to 3 times within a 30-second window. If the service restarts more than 3 times in 30 seconds, systemd should stop attempting to restart and leave the service in a failed state. Which set of directives should be added to the [Service] section of the unit file to achieve this behavior?
⚠ Common exam trap
A common mix-up: candidates confuse `Restart=always` (which restarts on any exit, including intentional stops) with `Restart=on-failure` (which only restarts on crashes), or they misremember the default values of `StartLimitBurst` and `StartLimitIntervalSec`, leading them to pick options with incorrect burst counts or intervals.
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=on-failure` and `StartLimitBurst=3` and `StartLimitIntervalSec=30`
It uses `Restart=on-failure` to trigger a restart only when the service crashes (not on other stops), combined with `StartLimitBurst=3` and `StartLimitIntervalSec=30` to limit restarts to 3 attempts within a 30-second window. When the burst limit is exceeded, systemd automatically places the unit in a failed state, exactly matching the requirement.
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=on-abort` and `MaxStartups=3`
Why it's wrong here
MaxStartups is not a systemd directive.
- ✗
`Restart=on-failure` and `StartLimitBurst=5` and `StartLimitIntervalSec=60`
Why it's wrong here
Burst count should be 3 and interval 30 seconds.
- ✗
`Restart=always` and `RestartSec=10`
Why it's wrong here
This restarts indefinitely without a burst limit.
- ✓
`Restart=on-failure` and `StartLimitBurst=3` and `StartLimitIntervalSec=30`
Why this is correct
This correctly limits restarts to 3 times within 30 seconds.
Go deeper
Related to this question
Learn chapter
Linux Fundamentals and History
Key term
Service
A service is a software component or system that performs a specific function and is available to be used by other programs or users over a network.
Key term
systemd
systemd is a system and service manager for Linux operating systems that initializes and manages processes, services, and system resources after the kernel boots.
About these practice questions
One of 979 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 →
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.