Courseiva
Service Configuration →easyMultiple Choice

LFCS Service Configuration Practice Question

A service named webserver.service is failing to start. The administrator wants to see the most recent error messages related to this service. Which command provides this information?

⚠ Common exam trap

Many exam-takers confuse `systemctl status` (which shows a brief log snippet) with `journalctl -u` (which provides the full, searchable journal), assuming the status command gives complete error history when it only shows a truncated view.

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

The `journalctl -u webserver.service` command queries the systemd journal for all log entries associated with the specified unit, showing the most recent error messages in reverse chronological order. This is the standard way to view detailed, time-stamped error logs for a failing service, as `journalctl` provides access to the binary journal that captures stdout, stderr, and syslog messages from the service.

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

    Why this is correct

    journalctl -u webserver.service queries the systemd journal filtered by the unit name, returning that service's logged output, including recent failure messages. The -u flag restricts entries to the specified unit, directly satisfying the requirement to isolate webserver.service errors rather than scanning the entire journal.

  • ✗

    systemctl status webserver.service --full

    Why it's wrong here

    The --full flag only suppresses truncation of status output, extending lines rather than retrieving journal entries; recent error messages require journalctl -u webserver.service. It is tempting because status does show a short log tail, and would be correct for a quick glance at unit state and the last few lines.

  • ✗

    systemctl list-units --type=service | grep webserver

    Why it's wrong here

    list-units enumerates loaded units and their high-level states, filtering by name here, but never displays the service's error output. It is tempting because it confirms whether the unit loaded, and would be correct when checking which services exist or are active on the system.

  • ✗

    systemctl is-active webserver.service

    Why it's wrong here

    is-active returns only the unit's current activation state, such as active or failed, printing no error text at all. It is tempting because it quickly confirms whether the service is running, and would be correct when a script needs a simple state check rather than diagnostic messages.

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