Courseiva
Service Configuration →mediumMultiple Choice

LFCS Service Configuration Practice Question

A Linux administrator needs to ensure that the nginx.service is restarted automatically if it crashes, but only after a 10-second delay, and that it does not restart more than 5 times within 1 minute to avoid a restart loop. Which set of directives in the [Service] section achieves this?

⚠ Common exam trap

The trap here is using StartLimitInterval instead of StartLimitIntervalSec, or confusing StartLimitBurst with the number of restarts allowed within the interval.

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

✓

Restart=on-failure, RestartSec=10, StartLimitIntervalSec=60, StartLimitBurst=5

The correct directives are Restart=on-failure, RestartSec=10, StartLimitIntervalSec=60, and StartLimitBurst=5. Restart=on-failure ensures restarts only on crashes, RestartSec=10 adds the delay, and the start limit directives restrict restarts to 5 per 60 seconds. The other options either use the wrong restart policy, an outdated directive name, or an incorrect burst value.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Restart=on-failure, RestartSec=10, StartLimitIntervalSec=60, StartLimitBurst=10

    Why it's wrong here

    Restart=on-failure and RestartSec=10 are correct, but StartLimitBurst=10 allows up to 10 restarts within 60 seconds, which exceeds the required limit of 5. This would permit more restart attempts than specified, potentially leading to a longer loop before systemd gives up. The burst value must be 5.

  • ✓

    Restart=on-failure, RestartSec=10, StartLimitIntervalSec=60, StartLimitBurst=5

    Why this is correct

    Restart=on-failure restarts the service only when it exits with a non-zero status or is killed by a signal. RestartSec=10 sets a 10-second delay before restarting. StartLimitIntervalSec=60 and StartLimitBurst=5 limit restarts to 5 within 60 seconds, preventing loops. This combination exactly matches the requirements.

  • ✗

    Restart=always, RestartSec=10, StartLimitInterval=60, StartLimitBurst=5

    Why it's wrong here

    Restart=always would restart the service even on a clean exit, which is not desired because the scenario specifies restart on crash. Also, StartLimitInterval is the old directive name; the current directive is StartLimitIntervalSec. Using the old name may cause systemd to ignore it, so the rate limiting would not work as intended.

  • ✗

    Restart=on-abnormal, RestartSec=10, StartLimitIntervalSec=60, StartLimitBurst=5

    Why it's wrong here

    Restart=on-abnormal restarts only on abnormal termination, such as signals or timeouts, but not on non-zero exit codes. If the service crashes with a non-zero exit status, it would not be restarted, failing the requirement to restart on crash. The correct restart policy for crashes is on-failure.

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 →

How Courseiva writes practice questions · Editorial policy

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.