[buildd-tools-devel] Bug#794471: schroot: /dev is not mounted if profile=sbuild

Johannes Schauer josch at debian.org
Mon Aug 3 12:16:52 UTC 2015


Package: schroot
Version: 1.6.10-1+b1
Severity: important

Hi,

recently, when using sbuild, I noticed that I could not build anything
anymore because I got the error:

	Can't open /dev/null: Permission denied

After some experimentation I figured out that the error would go away if
I removed "profile=sbuild" from my schroot configuration for the chroot
I was trying to build in. I didn't notice this problem earlier because
it seems that the last time I ran sbuild-createchroot was at a time when
#769289 wasn't fixed yet.

But now I'm able to reproduce this error with a plain schroot
invocation:

	sudo schroot -c sid-amd64-sbuild

And since /etc/schroot/sbuild/fstab is part of schroot and not sbuild, I
thought it be best to file it here.

After starting the above command I see the following being mounted (I
replaced the random part by XXX for brevity):

	tmpfs on /var/lib/schroot/mount/sid-amd64-sbuild-XXX type tmpfs (rw,nosuid,nodev,relatime,size=8388608k)
	proc on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/proc type proc (rw,nosuid,nodev,noexec,relatime)
	sysfs on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/sys type sysfs (rw,nosuid,nodev,noexec,relatime)
	devpts on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
	tmpfs on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/dev/shm type tmpfs (rw,relatime)
	/dev/mapper/hoothootvg-root on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/build type ext4 (rw,relatime,errors=remount-ro,data=ordered)

As you can see, /dev does not seem to be mounted. On the other hand, if
I comment out the "profile=sbuild" from my
/etc/schroot/chroot.d/sid-amd64-sbuild-XXX then the following gets
mounted:

	tmpfs on /var/lib/schroot/mount/sid-amd64-sbuild-XXX type tmpfs (rw,nosuid,nodev,relatime,size=8388608k)
	proc on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/proc type proc (rw,nosuid,nodev,noexec,relatime)
	sysfs on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/sys type sysfs (rw,nosuid,nodev,noexec,relatime)
	udev on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=1497918,mode=755)
	devpts on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
	devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
	/dev/mapper/hoothootvg-root on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/home type ext4 (rw,relatime,errors=remount-ro,data=ordered)
	tmpfs on /var/lib/schroot/mount/sid-amd64-sbuild-XXX/tmp type tmpfs (rw,nosuid,nodev,relatime,size=8388608k)

And this time /dev gets properly mounted.

I suppose the problem is in my /etc/schroot/sbuild/fstab but I did not
change that one. Just to be sure, here is its content:

	# fstab: static file system information for chroots.
	# Note that the mount point will be prefixed by the chroot path
	# (CHROOT_PATH)
	#
	# <file system> <mount point>   <type>  <options>       <dump>  <pass>
	/proc           /proc           none    rw,bind         0       0
	/sys            /sys            none    rw,bind         0       0
	/dev/pts        /dev/pts        none    rw,bind         0       0
	tmpfs           /dev/shm        tmpfs   defaults        0       0
	# Mount a large scratch space for the build, so we don't use up
	# space on an LVM snapshot of the chroot itself.
	/var/lib/sbuild/build  /build   none    rw,bind         0       0

And here are the relevant mounts (all but those marked as noauto) from
my systems /etc/fstab:

	UUID=98f708da-16c7-4081-8936-c662b8afd86b /     auto    errors=remount-ro 0 1
	UUID=058381ab-ed37-4ab5-94b2-decd606478c8 /boot auto    errors=remount-ro 0 1
	UUID=a72aa567-2bc8-47df-abfb-9e042bc2b083 swap  swap    sw                0 0
	tmpfs   /tmp         tmpfs   nodev,nosuid,size=8G          0  0
	tmpfs   /run         tmpfs   nodev,nosuid,size=8G          0  0
	tmpfs   /var/lib/schroot/unpack/         tmpfs   nodev,nosuid,size=8G          0  0
	tmpfs   /var/cache/pbuilder/build/       tmpfs   size=8G          0  0

I created the schroot just by running the command from the sbuild wiki.

Can you reproduce my findings?

Any idea what could be wrong?

Thanks!

cheers, josch


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: armhf, arm64

Kernel: Linux 4.0.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages schroot depends on:
ii  libboost-filesystem1.55.0       1.55.0+dfsg-4
ii  libboost-iostreams1.55.0        1.55.0+dfsg-4
ii  libboost-program-options1.55.0  1.55.0+dfsg-4
ii  libboost-regex1.55.0            1.55.0+dfsg-4
ii  libboost-system1.55.0           1.55.0+dfsg-4
ii  libc6                           2.19-18
ii  libgcc1                         1:5.1.1-14
ii  libpam0g                        1.1.8-3.1
ii  libstdc++6                      5.1.1-14
ii  libuuid1                        2.26.2-6
ii  schroot-common                  1.6.10-1

schroot recommends no packages.

Versions of packages schroot suggests:
pn  aufs-modules | unionfs-modules  <none>
pn  btrfs-tools                     <none>
ii  debootstrap                     1.0.70
ii  lvm2                            2.02.111-2.2
ii  qemu-user-static                1:2.3+dfsg-6a

-- no debconf information



More information about the Buildd-tools-devel mailing list