<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 28, 2015 at 3:39 PM, Peter Paule <span dir="ltr"><<a href="mailto:systemd-devel@fedux.org" target="_blank">systemd-devel@fedux.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Hi,<br>
<br>
I use `docker` to run containers. Each container uses `systemd` as PID 1. I pass `-v /var/log/journal:/var/log/journal` to `docker run` to accumulate journals on the docker host. Every time a container is started, a new journal file is generated based on the machine-id, leaving quite a few 8MiB-`system.journal`-files on the system after the container was "stopped".<br>
<br>
Example:<br>
<br>
~~~<br>
docker run --name centos-1 --rm -ti -v /sys/fs/cgroup:/sys/fs/cgroup -v /var/log/journal:/var/log/journal feduxorg/centos<br>
~~~<br>
<br>
Is there way beside `find /var/log/journal -time +30 -delete` to get rid of stale old `journal`.files? I tried `MaxRetentionSec=1day` and `MaxTimeSec=1day`, but none of this made `systemd-journald` to delete the `system.journal`-files.<br></blockquote><div><br></div><div>journald doesn't know all possible ways other machines' journals might appear here – the directory might belong to a *running* container, it might be written to over NFS by a thin client (where the client's journald might have different policies), it might be imported by journal-remote (where the admin might want to keep it for archival purposes), and so on.<br></div></div><div><br></div><div>Therefore journald will not delete journals with other machine-ids, since doing so would possibly apply two conflicting policies to the same logs – yours, and the container's/client's.<br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div></div>
</div></div>