[systemd-devel] Preventing custom Journal Log Corruption

P.R.Dinesh pr.dinesh at gmail.com
Wed Sep 20 11:13:56 UTC 2017


I use a service to extract few interesting logs from journal and store
seperately by using a service.

ExecStart=/lib/systemd/systemd-journal-remote
 --output=/var/log/critical/critical.journal --getter="journalctl -f
PRIORITY=3 -o export"


this service stores the journal file in  /var/log/critical/critical.journal

Now after system reboot, I get the following error message.

systemd-journal-remote[4833]: File /var/log/critical/critical.journal
corrupted or uncleanly shut down, renaming and replacing.


with this, the critical.journal is renamed as
critical at 000561f6d57153cf-c55b08dfcf5c7ad7.journal~ and a new
critical.journal file is created.

I found that the critical at 000561f6d57153cf-c55b08dfcf5c7ad7.journal~ is
also a valid file, if i use journal --file option, I am able to read logs
from this file.

I would like to know on how to avoid this corruption.
While debugging, I found that if I directly kill the systemd-journal-remote
process, then also I get this corrupted journal.  So I think that while
shutdown this service was killed improperly.

Is there any way I can avoid this corruption

Systemd version : 229
Distro : Custom Distribution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170920/0030d7c1/attachment.html>


More information about the systemd-devel mailing list