LFCS Service Configuration Practice Question
Exhibit
$ cat /etc/systemd/system/backup.service [Unit] Description=Backup Service After=network.target [Service] Type=oneshot ExecStart=/usr/local/bin/backup.sh User=backup Restart=on-failure RestartSec=30 [Install] WantedBy=multi-user.target $ systemctl show backup.service -p Restart Restart=no
Refer to the exhibit. The service unit file has Restart=on-failure, but systemctl show displays Restart=no. What is the most likely reason?
⚠ Common exam trap
Linux Foundation often tests the distinction between editing a unit file and reloading the daemon, trapping candidates who assume changes take effect immediately without running `systemctl daemon-reload`.
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 unit file was edited but systemctl daemon-reload was not run.
The most likely reason is that the unit file was edited but `systemctl daemon-reload` was not executed. When a service unit file is modified, systemd does not automatically reload the configuration; it continues to use the cached version until `systemctl daemon-reload` is run. This explains why `systemctl show` displays `Restart=no` despite the file containing `Restart=on-failure`.
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 User=backup directive overrides Restart.
Why it's wrong here
User does not affect the Restart setting.
- ✓
The unit file was edited but systemctl daemon-reload was not run.
Why this is correct
Without daemon-reload, systemctl show displays the previously loaded configuration.
- ✗
The unit is not enabled.
Why it's wrong here
Enable status does not affect the Restart property shown by systemctl show.
- ✗
The Restart directive is only valid for Type=simple.
Why it's wrong here
Restart works with all types, but for oneshot the default is no; the directive is still valid.
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.