Courseiva
Service Configuration →mediumMultiple Choice

LFCS Service Configuration Practice Question

A Linux administrator is troubleshooting a custom systemd service named backup.service that fails to start. They run systemctl status backup.service and see that the service is in a failed state, but the output does not show detailed error messages. Which command should they use to view the most recent log entries specifically for this service?

⚠ Common exam trap

The trap here is using systemctl status and expecting full logs, or using journalctl without unit filtering, which buries the relevant messages.

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

✓

journalctl -u backup.service -n 50

To view logs for a specific systemd unit, journalctl with the -u option is used. Adding -n specifies the number of recent lines. This filters the journal to only backup.service, providing the most recent error messages. Other commands like systemctl cat or show do not display logs, and journalctl -xe is not unit-specific.

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 -xe

    Why it's wrong here

    journalctl -xe shows recent journal entries with explanatory notes, but it is not filtered by unit. It would display logs from many services and the kernel, making it harder to isolate backup.service errors. While it might include the relevant messages, it is not the most precise command for this scenario.

  • ✓

    journalctl -u backup.service -n 50

    Why this is correct

    journalctl -u backup.service filters the journal by the specified unit and shows log entries for that service. The -n 50 option displays the most recent 50 lines. This command directly provides the recent error messages for backup.service, which is exactly what the administrator needs to troubleshoot the failure.

  • ✗

    systemctl show backup.service

    Why it's wrong here

    systemctl show displays properties of the unit, such as dependencies, restart policy, and current state. It does not include log output or error messages. It can be helpful for checking configuration, but it will not reveal the specific errors that caused the service to fail.

  • ✗

    systemctl cat backup.service

    Why it's wrong here

    systemctl cat displays the contents of the unit file and any drop-in files for backup.service. It does not show runtime logs or error messages. While useful for verifying configuration, it does not provide the recent error messages needed to diagnose why the service failed to start.

About these practice questions

This LFCS question is part of Courseiva's 406-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.