<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 02/08/2016 08:18 AM, Mantas
Mikulėnas wrote:<br>
</div>
<blockquote
cite="mid:CAPWNY8X2jSNPjcE909tJKsv2-M6t+Rnk_zuPN2VKWGPRgM0Z_w@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Mon, Feb 8, 2016 at 3:09 PM,
Daniel J Walsh <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:dwalsh@redhat.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:dwalsh@redhat.com">dwalsh@redhat.com</a></a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">I have
patches into docker to allow it to register with
machinectl and<br>
run systemd inside of the container without --privileges.
I also set it<br>
up so that the /var/log/journald/UUID on the host is
mounted inside of<br>
the container, so that journald inside of the container
writes to this<br>
location on the host.<br>
<br>
Then I use journalctl -M UUID on the host to look at the
host journal.<br>
When I run the first container it works great. I see the
container, but<br>
when I run the second container, I end up seeing the first
countainers<br>
journal again. If I strace journalctl -M uuid it looks
like it is<br>
reading all of the journals under /var/log/journalctl
rather then just<br>
the one for UUID.<br>
<br>
Am I doing something wrong when I set this up? How is
this supposed to<br>
work?<br>
</blockquote>
<div><br>
</div>
<div>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?</div>
</div>
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div dir="ltr">Mantas Mikulėnas <<a
moz-do-not-send="true" href="mailto:grawity@gmail.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:grawity@gmail.com">grawity@gmail.com</a></a>></div>
</div>
</div>
</div>
</blockquote>
<br>
<pre>docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
69730c6f4b85 httpd "/sbin/init" 7 minutes ago Up 7 minutes 80/tcp httpd
c8174de954b6 httpd "/sbin/init" 22 hours ago Up 7 minutes 80/tcp httpd1</pre>
<br>
<pre># machinectl
MACHINE CLASS SERVICE
69730c6f4b85ea61f5b9ddb9fb68cf7b container docker
c8174de954b6e3037926dfa8b15cc854 container docker </pre>
<br>
<pre># docker exec httpd cat /etc/machine-id
69730c6f4b85ea61f5b9ddb9fb68cf7b
# docker exec httpd1 cat /etc/machine-id
c8174de954b6e3037926dfa8b15cc854
No the /etc/machine-id is different, if I enter the container I see differences.
# docker exec httpd journalctl | head -1
-- Logs begin at Mon 2016-02-08 14:10:37 UTC, end at Mon 2016-02-08 14:10:38 UTC. --
# docker exec httpd1 journalctl | head -1
-- Logs begin at Sun 2016-02-07 15:36:19 UTC, end at Mon 2016-02-08 14:10:49 UTC. --
# journalctl -M 69730c6f4b85ea61f5b9ddb9fb68cf7b | head -1
-- Logs begin at Sun 2016-02-07 09:59:39 EST, end at Mon 2016-02-08 09:18:20 EST. --
# journalctl -M c8174de954b6e3037926dfa8b15cc854 | head -1
-- Logs begin at Sun 2016-02-07 09:59:39 EST, end at Mon 2016-02-08 09:18:40 EST. --
Where should I go for the output of this?
SYSTEMD_LOG_LEVEL=debug journalctl -M <uuid>
Is there a way for me to see the settings of _MACHINE_ID and _BOOT_ID? Also how can I see the actual path to the file journalctl is
reading?
</pre>
</body>
</html>