[buildd-tools-devel] Bug#726375: [Pkg-systemd-maintainers] Bug#726375: schroot: Fails during umount on system booted with systemd

Christoph Berg myon at debian.org
Mon Mar 10 15:00:45 UTC 2014


Control: tags -1 patch

Re: Michael Stapelberg 2013-11-12 <x661rxh0n3.fsf at midna.lan>
> Hi Antonio,
> 
> Antonio Terceiro <terceiro at softwarelivre.org> writes:
> > You have to create such a chroot first, for example with
> > sbuild-createchroot(1).
> >
> > I am affected by a similar problem, which also only happens when the
> > system is booted with systemd (works fine under sysvinit):
> >
> > $ cat /etc/schroot/chroot.d/squeeze
> > [squeeze]
> > type=directory
> > description=Debian Squeeze
> > directory=/home/terceiro/chroots/squeeze
> > users=terceiro
> > groups=terceiro
> > root-users=terceiro
> > root-groups=root
> > $ schroot -c squeeze
> > (squeeze) terceiro at homer:~$ exit
> > logout
> > E: 10mount: umount: /var/lib/schroot/mount/squeeze-78908cf6-2aca-4bf4-8209-fafe2260397f/tmp: not mounted
> > E: squeeze-78908cf6-2aca-4bf4-8209-fafe2260397f: Chroot setup failed: stage=setup-stop
> >
> > Then I have to manually finish the session:

Hi,

the problem is pretty bad - if you don't finish the session, but
re-enter it, you get new mounts for the left-over bindmounts, etc - an
exponential number of entries in /proc/mounts.

> > $ schroot -e -c squeeze-78908cf6-2aca-4bf4-8209-fafe2260397f
> Thanks for the steps to reproduce.
> 
> I think I found the issue: when running systemd, / is marked as a shared
> mountpoint by default, which recursively applies to everything
> underneath /. See mount(8) for details on shared mountpoints.

See #739593 for another incarnation of this issue.

> The attached patch fixes it for me. Quote from the patch itself:
> 
> +    # Mark this mountpoint as private, some systems have / as a shared mountpoint.
> +    # As an example, assume /home/m/ch is the chroot directory.
> +    # schroot will mount -o bind /home/m/ch to /var/lib/schroot/mount/ch-123
> +    # Afterwards, it will bind-mount /dev to /var/lib/schroot/mount/ch-123.
> +    # With shared mountpoints, that mount will also show up in the original
> +    # /home/m/ch. This is a problem once schroot mounted /home: the following
> +    # mount of /tmp will show up in /var/lib/schroot/mount/ch-123/tmp,
> +    # /home/m/ch/tmp and /home/m/ch/home/m/ch/tmp (!), which leads to failure
> +    # on unmounting.
> +    mount --make-private "$3"
> 
> I haven’t done thorough testing and I’m not familiar with the schroot
> codebase, so there may be side-effects of that patch. I can only
> reiterate: it works for me in my tests :).
> 
> Please consider merging it. Thanks.

I can confirm the patch fixes the problem here.

Christoph
-- 
cb at df7cb.de | http://www.df7cb.de/



More information about the Buildd-tools-devel mailing list