Courseiva
Service ConfigurationmediumMultiple ChoiceObjective-mapped

LFCS Service Configuration Practice Question

A system administrator is debugging why a service named 'myapp.service' fails to start. He runs 'systemctl status myapp.service' and sees the status 'failed' with details 'Exit code: 1' and 'Failed with result exit-code'. Which command should be used next to view the full log of the service?

⚠ Common exam trap

Watch out — candidates often confuse `systemctl show` (which shows unit properties) with `journalctl` (which shows logs), or think that the `-x` flag in `journalctl` is required to see the full log when it only adds explanatory catalog messages, not the actual service output.

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 myapp.service

The correct command is `journalctl -u myapp.service` because it retrieves the full systemd journal logs for the specified unit, showing detailed error messages, stdout/stderr output, and timestamps that explain why the service exited with code 1. The `-u` flag filters the journal to entries related to that specific service unit, which is essential for debugging exit-code failures.

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 myapp.service

    Why this is correct

    Correct: `journalctl -u myapp.service` retrieves the full systemd journal logs for the specified unit, showing detailed error messages and output that explain why the service exited with code 1.

  • systemctl show myapp.service

    Why it's wrong here

    Incorrect: `systemctl show myapp.service` displays unit properties and configuration, not the service's runtime log output.

  • journalctl -x -u myapp.service

    Why it's wrong here

    Incorrect: While `journalctl -x -u myapp.service` also shows logs, the `-x` flag adds catalog message explanations that may clutter the output and are not necessary to see the actual service logs. The plain `-u` flag is sufficient.

  • systemctl list-dependencies myapp.service

    Why it's wrong here

    Incorrect: `systemctl list-dependencies myapp.service` shows the dependency tree of the unit, not its log entries.

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 →

How Courseiva writes practice questions · Editorial policy

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.