<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - journald doesn't rotate uncleanly closed files"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=58549">58549</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>journald doesn't rotate uncleanly closed files
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>d@falconindy.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Copypasta of my original reply on the ML:
<a href="http://lists.freedesktop.org/archives/systemd-devel/2012-November/007585.html">http://lists.freedesktop.org/archives/systemd-devel/2012-November/007585.html</a>

---------8<-----------------------------------------------------------
I'm not sure when it happened, but rotation used to be "off" by a
difference of whatever the MaxFileSize option was, e.g. if you had a
200M MaxUse and a 50M MaxFileSize, then you'd see usage up to 250M
before old logs were expired. I reported this, and there was a TODO item
added.

At least with 196 (maybe earlier), this no longer holds true any more.
The journal appears to just ignore settings in journald.conf and grow
without bound:

$ grep -E 'SystemMax(Use|FileSize)' /etc/systemd/journald.conf
SystemMaxUse=200M
SystemMaxFileSize=50M

$ journalctl --disk-usage
Journals take up 436.0M on disk.

Forcing rotation opens a new file, but old logs are not expired, leaving
disk usage way above the set maximum. There also seems to be a recent
issue with more uncleanly closed journal files showing up. Unless I
umount my root at shutdown (with initramfs magic), I can very reliably
expect that the journal will mark the last used file as unclean on the
next bootup. My suspicion is that the journal doesn't take into account
these uncleanly closed files when calculating disk usage for rotation,
but I've not had time to confirm that.
-----------------------------------------------------------8<---------

And to add, I've gone back and confirmed that rotation still happens,
and that actual maximum "managed" usage is:

 SystemMaxUse + (NumFilesOpen * SystemMaxFileUseSize)

But there indeed seems to be no attention paid to the tilde suffixed
files, which inflate this amount above the aforementioned maximum.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>