nerdexam
CompTIACompTIA

XK0-005 · Question #475

XK0-005 Question #475: Real Exam Question with Answer & Explanation

The correct answer is C: sed -i 's/auto/persistent/g' /etc/systemd/journald.conf && sed -i 'persistent/s/^#//q'. To ensure systemd journal logs persist across system reboots, the Storage parameter in /etc/systemd/journald.conf must be set to persistent and the systemd-journald service restarted.

System Management

Question

A development team asks an engineer to guarantee the persistency of journal log files across system reboots. Which of the following commands would accomplish this task?

Options

  • Agrep -i auto /etc/systemd/journald.conf && systemctl restart systemd-journald.service
  • Bcat /etc/systemd/journald.conf | awk '(print $1,$3)'
  • Csed -i 's/auto/persistent/g' /etc/systemd/journald.conf && sed -i 'persistent/s/^#//q'
  • Djournalctl --list-boots && systemctl restart systemd-journald.service

Explanation

To ensure systemd journal logs persist across system reboots, the Storage parameter in /etc/systemd/journald.conf must be set to persistent and the systemd-journald service restarted.

Common mistakes.

  • A. grep -i auto /etc/systemd/journald.conf only searches for the string 'auto' and does not modify the configuration for persistence.
  • B. cat /etc/systemd/journald.conf | awk '(print $1,$3)' merely displays parts of the configuration file and does not implement any changes to ensure log persistence.
  • D. journalctl --list-boots displays boot journal entries, which would be empty or incomplete if persistence is not configured, and restarting the service alone without configuration changes will not enable persistence.

Concept tested. systemd journal persistence configuration

Reference. https://www.freedesktop.org/software/systemd/man/journald.conf.html

Topics

#systemd-journald#Log Persistence#Configuration Management#sed command

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions