[Buildd-tools-devel] Bug#428805: Bug#428805: schroot: Fails to start a "directory" chroot

Roger Leigh rleigh at whinlatter.ukfsn.org
Thu Jun 14 21:52:32 UTC 2007


Raphael Hertzog <hertzog at debian.org> writes:

> Hello,

Hi!

> I upgraded to sid yesterday and schroot is now broken for me:
>
> rhertzog at rivendell:~$ schroot -c sarge
> mount: proc already mounted or /var/lib/schroot/mount/sarge-664c9622-4459-4624-93d0-e4bb10aa965b/proc busy
> mount: according to mtab, proc is mounted on /proc
> E: sarge-664c9622-4459-4624-93d0-e4bb10aa965b: Chroot setup failed: stage=setup-start

> I customized /etc/schroot/setup.d/10mount but simply by adding two lines:
> @@ -81,7 +100,7 @@
>             do_mount "-t tmpfs"   "tmpfs"    "${CHROOT_PATH}/dev/shm"
>             do_mount "-o rw,bind" "/home"    "${CHROOT_PATH}/home"
>             do_mount "-o rw,bind" "/tmp"     "${CHROOT_PATH}/tmp"
> +           # RH-specific hack
> +           test -e "${CHROOT_PATH}/etc/.host" || mkdir -p "${CHROOT_PATH}/etc/.host"
> +           do_mount "-o rw,bind" "/etc"     "${CHROOT_PATH}/etc/.host"
>         fi

In the coming weeks, I am aiming to make all this customisable, and
remove all this hard-coded mounting.  I'm just trying to find time.
(I wrote most of the code last weekend--I just need to test it and
then update the setup scripts to source the necessary customised
config file).

> This change is certainly not responsible of the failure that I
> have. At first look, it rather looks like a new behaviour of "mount"
> (or something more stupid, like the /proc mount point not existing).

It's possibly mount.  You should be able to mount a filesystem on top
of another, even if it's the same one and it doesn't make sense.

> My chroot is defined this way:
> [sarge]
> type=directory

This is the cause of the problem.  Try "plain" and also see the
section "Plain and directory chroots" in schroot.conf(5).

The distinction here is that "plain" schroots are assumed to have all
the necessary filesystems pre-mounted e.g. in /etc/fstab.  On the
other hand, directory chroots assume that no filesystems are
pre-mounted and that schroot should mount them all for you.

I think in this case, you might find "plain" is a better fit for your
needs than "directory" (though the two are otherwise identical in all
respects).


Regarding your other mail, we could indeed check whether the directory
is mounted before mounting.  However, I'm not sure we can assume that
the user doesn't want a filesystem mounting over the top of another
(we don't know if they are the same or not).  This would be possible
for real filesystems where we can stat the block device and mountpoint
and compare the block-major and -minor numbers.  However, for procfs,
devpts, tmpfs et. al., this is not really possible AFAICT--the device
numbers are not easily accessible or can vary.  Do you have any
thoughts here?

do_mount already creates the mountpoint if not already existing, BTW.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20070614/c8be2b33/attachment.pgp 


More information about the Buildd-tools-devel mailing list