LFCS Service Configuration Practice Question
An administrator deploys a new custom service using a unit file called myapp.service. The service needs to start automatically at system boot. Which command should the administrator run to achieve this?
⚠ Common exam trap
Candidates often confuse `systemctl start` (which runs the service now) with `systemctl enable` (which configures automatic startup at boot), leading them to select option A incorrectly.
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
✓
systemctl enable myapp.service
The `systemctl enable` command creates the necessary symlinks in the systemd unit configuration directories (e.g., `/etc/systemd/system/multi-user.target.wants/`) to ensure the service is started automatically at boot. This is the correct method to enable a service to start on boot in a systemd-based Linux system.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
systemctl start myapp.service
Why it's wrong here
start launches the unit only for the current session; it creates no enablement symlink, so the service will not come up after reboot. It is correct when you need the service running now, not persistently.
- ✓
systemctl enable myapp.service
Why this is correct
systemctl enable creates the symlinks defined by the unit's [Install] section, wiring myapp.service into the appropriate target's .wants directory so systemd starts it at boot. Starting it immediately would instead require systemctl start, which does not persist across reboots.
- ✗
systemctl add-wants myapp.service
Why it's wrong here
add-wants creates a Wants dependency from a target to a unit, but the syntax requires a target argument and does not establish boot enablement by itself. It suits adding a dependency to an existing target.
- ✗
systemctl daemon-reload myapp.service
Why it's wrong here
`systemctl daemon-reload` only re-reads unit files after they change on disk; it does not create the symlink in the target's `.wants` directory that triggers start at boot. It is tempting because daemon-reload is genuinely required after editing or adding a unit file, but enabling the service needs `systemctl enable myapp.service`.
Go deeper
Related to this question
About these practice questions
One of 406 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.