Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Journald use real syslog

I have a few systems that use systemd. I feel that it is a fine service manager, but the whole systemd project keeps subsuming other functions and getting more bloated, and also chooses terrible default values! Don't give me any lip about how it's a function of the distro's packaging that makes systemd's defaults bad: I'm talking about CentOS here, so THE systemd distro. Its package defaults are systemd defaults.

To make sure you actually have logs that last longer than a reboot, you need to change from the default. Make sure rsyslog is installed, and then modify journald configs.

Inside file /etc/systemd/journald.conf:

[Journal]
Storage=persistent

Also mkdir /var/log/journal. And then systemctl restart systemd-journald because they love their name so much you need it add it in front of many things. As if there's some other possible "journald" that people could possibly use.

So after this manual configuration, you can actually investigate what happened before your system shut down. Thanks a lot, [censored].

References

  1. https://www.redhat.com/sysadmin/store-linux-system-journals

Comments