LFCS Service Configuration Practice Question
A Linux administrator is managing a systemd service called app.service that runs a Java application. The service is configured with Restart=on-failure and RestartSec=5. After a recent update, the application crashes immediately upon start with exit code 1. The administrator notices that systemd keeps restarting the service every 5 seconds indefinitely. Which command should the administrator use to view the number of times the service has been restarted and the current restart limit status?
⚠ Common exam trap
The trap here is assuming that systemctl status or journalctl will show the restart count, but only systemctl show exposes the NRestarts property and limit settings.
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 show app.service -p NRestarts -p StartLimitBurst -p StartLimitIntervalSec
To see the number of restarts and the restart limit configuration, systemctl show with specific properties is the correct tool. NRestarts gives the count, while StartLimitBurst and StartLimitIntervalSec define the rate limiting. Other commands provide logs or status but not these internal counters.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
journalctl -u app.service -n 50
Why it's wrong here
journalctl shows log messages for the service, which can indicate repeated failures, but it does not show systemd's internal restart counters or rate-limiting settings. The logs might show timestamps of restarts, but not the exact count or limits.
- ✗
systemctl status app.service
Why it's wrong here
systemctl status provides a summary including recent log lines and whether the service is active, but it does not display the number of restarts or the configured restart limits. It may show a generic message about restarting, but not the specific counters.
- ✓
systemctl show app.service -p NRestarts -p StartLimitBurst -p StartLimitIntervalSec
Why this is correct
systemctl show with -p (property) can display specific properties. NRestarts shows the number of automatic restarts, StartLimitBurst and StartLimitIntervalSec show the rate limiting parameters. This command provides exactly the restart count and limit configuration, helping diagnose the restart loop.
- ✗
systemctl list-units --state=failed
Why it's wrong here
This command lists units that have failed, but app.service may not be in a failed state because it is continuously restarting. It does not provide restart counts or limit information, and is not useful for this specific diagnostic need.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LFCS question from scratch — 406 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint
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.