DEV Community

Brisbane Web Developer
Brisbane Web Developer

Posted on

10 1

Amend "Journal has been rotated since unit was started..."

Summary

systemctl status xxx shows the message:

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
Enter fullscreen mode Exit fullscreen mode

The cause

In my case, the disk usage of the log files for journald was maxed out.

  • du -sh /run/log/journal let you see the disk usage.

  • The default maximum usage is 10% of the disk size.

    • It depends on your situation, but if /run is in a different partition from the one for /, you must refer the disk size for /run instead.

Amendment

Step 1

Amend the file /etc/systemd/journald.conf.

  • SystemMaxUse for /var/log/journal.

    • My machine did not have the directory so I did not apply this setting.
  • RuntimeMaxUse for /run/log/journal.

/etc/systemd/journald.conf
==========
SystemMaxUse=100M
RuntimeMaxUse=100M
Enter fullscreen mode Exit fullscreen mode

Step 2

Shrink the disk usage by deleting old archived log files:

journalctl --vacuum-time=2weeks
# OR
journalctl --vacuum-size=20M
Enter fullscreen mode Exit fullscreen mode

Step 3

Restart journald.

I am actually not sure if it is OK to use systemctl restart as it may lose some logs, but I could not have found a better way (Restart instead?):

journalctl --rotate && \
systemctl restart systemd-journald
Enter fullscreen mode Exit fullscreen mode

Useful Commands

journalctl --disk-usage
# OR
du -sh /run/log/journal
Enter fullscreen mode Exit fullscreen mode
journalctl --verify
Enter fullscreen mode Exit fullscreen mode
ls -l /run/log/journal/*
Enter fullscreen mode Exit fullscreen mode
systemctl status systemd-journald
Enter fullscreen mode Exit fullscreen mode

References

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (1)

Collapse
 
talkinwalkdave profile image
Dave

Extremely helpful, thank you!

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay