PAS-C01 Operations and Maintenance Practice Question
A DevOps engineer needs to automatically restart a specific service on an EC2 instance whenever the service crashes. The instance is running Amazon Linux 2. Which approach is the MOST operationally efficient?
⚠ Common exam trap
The trap here is that candidates often over-engineer the solution by choosing external AWS services (CloudWatch, Lambda) or traditional cron-based polling, overlooking the fact that the operating system's native service manager (systemd) already provides a simple, built-in mechanism for automatic service restart.
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
✓
Configure the service as a systemd unit with Restart=on-failure
Systemd, the default init system on Amazon Linux 2, provides a built-in `Restart=` directive that can be set to `on-failure`. This instructs systemd to automatically restart the service unit when it exits with a non-zero exit code or is terminated by a signal, without requiring any external monitoring or additional infrastructure. This is the most operationally efficient approach as it leverages the native service manager functionality with zero external dependencies.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set up a CloudWatch alarm that triggers an SSM Run Command to restart the service
Why it's wrong here
This adds extra components and latency compared to a simple systemd configuration.
- ✗
Write a cron job that checks the service status every minute and restarts it if needed
Why it's wrong here
Cron adds polling overhead and is not as responsive as systemd.
- ✓
Configure the service as a systemd unit with Restart=on-failure
Why this is correct
systemd is the native init system and handles restarts efficiently.
- ✗
Use an AWS Lambda function that polls the service status and calls the EC2 reboot API
Why it's wrong here
Lambda is not designed for this low-level system management and adds complexity.
Go deeper
Related to this question
About these practice questions
One of 1,616 original PAS-C01 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 PAS-C01 practice question is part of Courseiva's free Amazon Web Services 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 PAS-C01 exam.