You are not logged in.

#1 2013-09-18 14:49:02

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 692

Systemd journal - a design problem apparent at system crash

In recent times when I have been testing kernels, particularly self-compiled or testing kernels, there have been occasions when the kernel has crashed, resulting in corrupted systemd journal files if the system fails without a clean shutdown of the systemd-journald service.  This has led to a situation where the log files containing important lines that might lead to vital information about what could underlie the kernel crash or system freeze has then become unrecoverable.

After such a system freeze or crash doing

 # journalctl --verify 

then shows errors in the journal files and using journalctl will then usually or often be unable to read the lines that were produced in the run-up to the system fail.

I have been unable to find any reference for a method to recover the information when this happens and the only method that I know to then get the systemd journal working sanely again is to stop the systemd-journald service, delete or move the /var/log/journal directory and create a new one - then reboot the system to create new journal files.

The route cause of this problem seems to be the use of binary files in the journal instead of ascii files. 

Does anyone know of a method to recover the journal files once they have been corrupted due to an unclean shutdown?  If not, then is there a way to get systemd to write ascii log files instead of binary files?


Mike C

Offline

#2 2013-09-18 14:58:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: Systemd journal - a design problem apparent at system crash

Have a look at https://bugs.archlinux.org/task/32191

Have you tried redirecting the journal via syslog to the good ol' plaintext logs?

Offline

#3 2013-09-18 15:17:20

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 692

Re: Systemd journal - a design problem apparent at system crash

karol wrote:

Have a look at https://bugs.archlinux.org/task/32191

Have you tried redirecting the journal via syslog to the good ol' plaintext logs?

Thanks - it is a long-standing problem - and yes I have used syslog on one of my machines to generate a plaintext log file - but having the main system use binary files and having to work around to get a second level copy in ascii seems not the most efficient way forward!  The better way would be for systemd to generate plaintext log files in the first place!  However I expect that any plea in that direction upstream will likely not receive a positive response. So the problem actually still remains.


Mike C

Offline

#4 2013-09-20 17:08:21

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Systemd journal - a design problem apparent at system crash

As far as I know you can tell journald not to store any binary log files and let syslog generate plaintext logs instead. Or you can just start/enable the syslog service while you do some testing and stop/disable it when you're done.

Offline

#5 2013-10-24 11:41:54

Zucca
Member
From: KUUSANKOSKI, Finland
Registered: 2009-02-26
Posts: 135

Re: Systemd journal - a design problem apparent at system crash

cookies wrote:

As far as I know you can tell journald not to store any binary log files and let syslog generate plaintext logs instead. Or you can just start/enable the syslog service while you do some testing and stop/disable it when you're done.

You mean editing /etc/systemd/journald.conf and then installing some syslogger daemon?

I had a crash few days ago... That time journald really showed its weakness. The whole log file was corrupted.
If you ask me for one thing that I would modify in systemd it's the removal of binary log files. They tend to take more space than normal log files and compress poorly. Btrfs with compression on /var/log just screams for plain text log files. wink

From this day on I will set up journald to store logs only in memory and syslogger to store plain text log files to /var/log.


K.i.s.s. <3

Offline

Board footer

Powered by FluxBB