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…
Question
Options
- Aappend Howdy
- Blogger Howdy
- Csystemd-cat echo Howdy
- Decho Howdy > /dev/journal
- Ejournalctl add Howdy
How the community answered
(29 responses)- B10% (3)
- C3% (1)
- D7% (2)
- E79% (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) -appendis not a standard Linux command. - D (
echo Howdy > /dev/journal) -/dev/journalis not a writable device node; the journal accepts input through its socket, not a device file. - E (
journalctl add Howdy) -journalctlis a read/query tool for inspecting journal entries; it has noaddsubcommand 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
Community Discussion
No community discussion yet for this question.