Interview Prep/Linux/Processes, services and systemd

The journal is lost on every reboot and you need logs from before a crash. What do you change?

BeginnerScenarioProcesses, services and systemd
Answer

Situation read → journald is in volatile mode.

What I'd do →

sudo mkdir -p /var/log/journal
sudo systemd-tmpfiles --create --prefix /var/log/journal
sudo sed -i 's/^#\?Storage=.*/Storage=persistent/' /etc/systemd/journald.conf
sudo systemctl restart systemd-journald
journalctl --list-boots

Afterwards use journalctl -b -1 -e for the previous boot.

Why → With Storage=auto, journald persists only if /var/log/journal exists.

Interview tip → Pair it with SystemMaxUse= so persistent logs don't fill the disk.

All Linux questions Roadmap: Linux

More on Processes, services and systemd