LFCS Service Configuration Practice Question
Exhibit
Refer to the exhibit. [Unit] Description=My Custom Service After=network-online.target Wants=network-online.target [Service] ExecStart=/usr/local/bin/myservice.sh Restart=always RestartSec=10 [Install] WantedBy=multi-user.target
Which of the following statements is true about this unit?
⚠ Common exam trap
Linux Foundation often tests the misconception that `Restart=always` only applies to non-zero exit codes, when in fact it triggers restarts for any exit status, including successful exits (exit code 0).
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
✓
The service will be restarted indefinitely with a 10-second delay between restarts regardless of exit status
The `Restart=always` directive in a systemd service unit causes the service to be restarted indefinitely regardless of the exit status, and the `RestartSec=10` directive introduces a 10-second delay between each restart attempt. This behavior is defined in the systemd.service(5) man page, where `Restart=always` triggers a restart for any exit reason, including clean exits or signals.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The service will be restarted indefinitely with a 10-second delay between restarts regardless of exit status
Why this is correct
Restart=always triggers on any exit, with RestartSec delay.
- ✗
The service can be started by a timer unit
Why it's wrong here
Possible but not indicated in the unit.
- ✗
The service will start automatically at boot only if network-online.target is reached
Why it's wrong here
Wants is weak; service may start even if target fails.
- ✗
The service requires SELinux context
Why it's wrong here
Not mentioned in the unit.
Go deeper
Related to this question
About these practice questions
One of 507 original LFCS 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 LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.