[systemd-devel] I am trying to hook up docker and systemd.

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Dec 24 19:09:06 PST 2014


On Mon, Dec 22, 2014 at 09:20:03AM -0500, Daniel J Walsh wrote:
> I have a working version of docker which runs systemd/journald within
> the container and sets up the /var/log/journal/UUID inside the container
> to match the version outside.  I also have registered the container with
> machinectl.  Everything seems to work fine except that when I execute
> 
> journalctl -M UUID
> 
> I get a message saying no logs available.  I then attempted the same
> thing with systemd-nspawn, and again  I get no logs availabel.  If I
> send a SIGUSR1 to the journal process it finally writes its logs and the
> journalctl on the outside sees it.  Is there a way to get the logs to
> continuously be written, so jounralctl -M UUID will be able to monitor
> the logs, without having to send the SIGUSR1?
That's a little surprising. journald will create an output immediately
on startup. In /var/log/journal if available, in /run/log/journal otherwise.
On USR1 it'll move logs from /run/log/journal to /var/log/journal. So it
would seem that /var/log/journal is not available when the systemd-journald
is initially started, but becomes available later on, which would suggest
some race condition in the setup.

I think you should lsof systemd-journald in the container and see what
files it has open (e.g. /path/to/container/var/log/journal/UUID/system.journal).

Zbyszek


More information about the systemd-devel mailing list