[systemd-devel] Trying to get journalctl -M UUID to work with docker containers

Mantas Mikulėnas grawity at gmail.com
Mon Feb 8 14:18:03 CET 2016


On Mon, Feb 8, 2016 at 3:09 PM, Daniel J Walsh <dwalsh at redhat.com> wrote:

> I have patches into docker to allow it to register with machinectl and
> run systemd inside of the container without --privileges.  I also set it
> up so that the /var/log/journald/UUID on the host is mounted inside of
> the container, so that journald inside of the container writes to this
> location on the host.
>
> Then I use journalctl -M UUID on the host to look at the host journal.
> When I run the first container it works great.  I see the container, but
> when I run the second container, I end up seeing the first countainers
> journal again.  If I strace journalctl -M uuid it looks like it is
> reading all of the journals under /var/log/journalctl rather then just
> the one for UUID.
>
> Am I doing something wrong when I set this up?  How is this supposed to
> work?
>

If I remember correctly, -M adds a filter for _MACHINE_ID and _BOOT_ID? Try
`SYSTEMD_LOG_LEVEL=debug journalctl -M <uuid>` to verify. Maybe your
containers actually have identical '/etc/machine-id's?

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160208/cf80e3bd/attachment.html>


More information about the systemd-devel mailing list