nerdexam
LPI

102-500 · Question #78

On a system using systemd-journald, which of the following commands add the message Howdy to the system log? (Choose two.)

The correct answer is E. journalctl add Howdy. There appears to be an error in the provided answer key - E is actually incorrect, and the true correct answers are B and C. logger Howdy (B) is a standard POSIX utility that writes directly to the system log; on systemd systems it routes to journald, making it the most…

Essential System Services

Question

On a system using systemd-journald, which of the following commands add the message Howdy to the system log? (Choose two.)

Options

  • Aappend Howdy
  • Blogger Howdy
  • Csystemd-cat echo Howdy
  • Decho Howdy > /dev/journal
  • Ejournalctl add Howdy

How the community answered

(29 responses)
  • B
    10% (3)
  • C
    3% (1)
  • D
    7% (2)
  • E
    79% (23)

Explanation

There appears to be an error in the provided answer key - E is actually incorrect, and the true correct answers are B and C.

logger Howdy (B) is a standard POSIX utility that writes directly to the system log; on systemd systems it routes to journald, making it the most portable choice for scripting log entries. systemd-cat echo Howdy (C) connects the stdout of a command to the journal, so the output of echo Howdy is captured and stored as a journal entry.

Why the distractors fail:

  • A (append Howdy) - append is not a standard Linux command.
  • D (echo Howdy > /dev/journal) - /dev/journal is not a writable device node; the journal accepts input through its socket, not a device file.
  • E (journalctl add Howdy) - journalctl is a read/query tool for inspecting journal entries; it has no add subcommand and cannot write to the log.

Memory tip: Think of the two writers - logger (the classic syslog writer) and systemd-cat (the systemd-native pipe). journalctl is a reader, like a catalog browser - you look things up in a catalog, you don't add items to a store through it.

Topics

#systemd-journald#logger#system-logging#systemd-cat

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice