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.
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.confonly 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-bootsdisplays 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
Community Discussion
No community discussion yet for this question.