LFCS Service Configuration Practice Question
A company runs a web application stack consisting of a frontend web server (web.service) and a backend application server (app.service). The app.service uses Restart=on-failure to automatically restart if it crashes. The administrator wants the web.service to automatically restart whenever app.service restarts, so that the frontend remains in sync with the backend. Which directive should be added to the web.service unit file's [Unit] section to achieve this?
⚠ Common exam trap
Watch out — candidates often confuse PartOf with BindsTo, assuming the stronger dependency is always better, but PartOf is the correct choice because it only propagates restarts without creating a hard binding that would prevent independent startup or cause the frontend to be stopped if the backend fails.
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
✓
PartOf=app.service
(PartOf=app.service) is correct because when app.service stops or restarts, PartOf causes systemd to stop or restart web.service as well, keeping the frontend in sync with the backend. Unlike BindsTo, PartOf does not create a strict dependency that would prevent app.service from starting independently, and it ensures the frontend follows the backend's state changes without requiring the backend to be fully operational for the frontend to start.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
BindsTo=app.service
Why it's wrong here
Stops web.service if app.service stops, but does not restart.
- ✓
PartOf=app.service
Why this is correct
Propagates stop/restart from app.service to web.service.
- ✗
Requires=app.service
Why it's wrong here
Only ensures app.service is started, does not propagate restarts.
- ✗
Wants=app.service
Why it's wrong here
Weak dependency, no restart propagation.
Visual reference
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.