[systemd-devel] Systemd in LXC container

Alexander Vladimirov alexander.idkfa.vladimirov at gmail.com
Tue Nov 20 00:23:49 PST 2012


sorry, replied off-list by mistake

2012/11/20 Lennart Poettering <lennart at poettering.net>

> On Fri, 16.11.12 13:05, Alexander Vladimirov (
> alexander.idkfa.vladimirov at gmail.com) wrote:
>
> > Using recommendations here:
> >
> http://www.mail-archive.com/systemd-devel@lists.freedesktop.org/msg06972.html
> > and updated lxc-archlinux template I have managed to run (almost)
> > unmodified Arch Linux installation in container.
> > This exposed a couple of problems in systemd.
> > The first one is: systemd goes through /proc/self/mountinfo entries to
> > perform unmount actions on shutdown. when running in container, it
> contains
> > root filesystem entry, which systemd fails to unmount, resulting in
> unclean
> > shutdown.
>
> Well, how that? the root fs should be owned by the host, so be unmounted
> by it later on?
>
That what I assumed, but I might be wrong.

>
> > I was able to fix it using simple patch (http://pastie.org/5380592)
> which
> > makes systemd ignore root mount when running in container.
>
> Hmm, the code in mount_points_list_umount() in umount.c already exlcudes
> / and /usr from all unmounting?
>
Yes, it does, but those filesystems are counted as failed then, and systemd
reports that it cannot unmount all filesystems.
I was guessing if it could be the reason why journal gets corrupted and it
turns out it's not.
It still seems a bit useful, since it prevents systemd from printing
cryptic warnings about failed unmounts without actual filesystem name.

>
> > The second issue is journald reporting journal corruption on every
> > container boot, regardless of clean shutdown. This also happens when I
> > bind-mount hosts journal directory into container.
>
> Hmm, this is interesting. Do you see any messages about journal shutting
> down in the journal?
>
That's  what container's journal look like after shutdown:
http://pastie.org/private/njgmtyxdglrpx3qxspufog,
there's no warnings or errors on console during or after shutdown.

>
> > Can anyone provide any insights on how can I find out what causes journal
> > corruption?
>
> I'll try to reproduce this here.
>
I will be happy to provide any assistance you need.

>
> Lennart
>
> --
> Lennart Poettering - Red Hat, Inc.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20121120/65fbb7ef/attachment.html>


More information about the systemd-devel mailing list