LFCS Service Configuration Practice Question
To ensure a service starts only after /var/lib/mysql is mounted, which directive should be used in the unit file?
⚠ Common exam trap
A common mix-up: candidates confuse `After=` with `Requires=` or `BindsTo=`, thinking that dependency directives alone enforce startup order, but systemd separates ordering from dependency requirements.
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
✓
After=var-lib.mount
The `After=` directive in a systemd unit file specifies that the current unit should start only after the listed units have been activated. By setting `After=var-lib.mount`, the service will wait until the mount unit for `/var/lib/mysql` is fully mounted before starting, ensuring the required filesystem is available.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Requires=/var/lib/mysql
Why it's wrong here
Requires expects a unit name, not a path.
- ✗
BindsTo=var-lib.mount
Why it's wrong here
BindsTo binds service lifecycle to mount, but does not ensure startup order.
- ✗
Before=var-lib.mount
Why it's wrong here
Before would start the service before the mount.
- ✓
After=var-lib.mount
Why this is correct
After ensures the service starts after the mount unit.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LFCS question from scratch — 507 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.