Control: reassign -1 schroot
Control: retitle -1 schroot fails to unmount chroot on failure in setup.d 
scripts

Hi Ryan,

Quoting Ryan Kavanagh (2016-02-19 23:30:13)
> On Fri, Feb 19, 2016 at 09:07:46PM +0100, Johannes Schauer wrote:
> > Quoting Ryan Kavanagh (2016-02-19 18:56:32)
> > > rak@zeta:~$ sbuild-update -udr source:jessie-amd64
> > > E: 15binfmt: update-binfmts: unable to open 
> > > /var/run/schroot/mount/jessie-snap-a6a720c2-d20d-4251-b3a5-1e043da0e1e2/bin/sh:
> > >  No such file or directory
> > > E: 20copyfiles: cp: cannot create regular file 
> > > '/var/run/schroot/mount/jessie-snap-a6a720c2-d20d-4251-b3a5-1e043da0e1e2/etc/resolv.conf':
> > >  No such file or directory
> > > E: jessie-snap-a6a720c2-d20d-4251-b3a5-1e043da0e1e2: Chroot setup failed: 
> > > stage=setup-start
> > > Chroot setup failed
> > > Error setting up source:jessie-amd64 chroot
> > > Chroot setup failed at /usr/bin/sbuild-update line 170.
> > 
> > this error looks strange.
> > 
> > Can you tell me a way how I can reproduce the problem you have with
> > sbuild-update?
> 
> The above error is a classic case of PEBKAC. I accomplished it roughly
> as follows:
> 
> mkfs.ext4 /dev/wd/jessie-chroot
> mkdir /tmp/jessie
> mount /dev/wd/jessie-chroot /tmp/jessie
> sbuild-createchroot jessie /tmp/wd-jessie-chroot 
> http://httpredir.debian.org/debian
> umount /tmp/jessie
> ... delete /etc/schroot/schroot.d/* and add the appropriate LVM snapshot
> ... config entry to /etc/schroot/schroot.conf
> suild-update -udr source:jessie-amd64
> 
> which then caused a snapshot of /dev/wd/jessie-chroot to get mounted,
> which was empty (I fed the wrong path to sbuild-createchroot), and so
> sbuild-update obviously couldn't find bin/sh under it :)
> 
> So, I suppose this should be considered a 'wishlist' bug, where
> sbuild-update should fail gracefully and umount stuff even on failure.

thanks, this allowed me to reproduce this. Though don't think that sbuild can
do anything about this problem, as I think it is schroot which fails to clean
up after failing to begin the session.

Steps to reproduce:

$ cat /etc/schroot/chroot.d/unstable-amd64-sbuild-Y0L33s
[unstable-amd64-sbuild]
type=file
description=Debian unstable/amd64 autobuilder
file=/srv/chroot/unstable-amd64.tar.gz
groups=root,sbuild
root-groups=root,sbuild
profile=sbuild
$ mkdir empty
$ tar -C empty -czf empty.tar.gz .
$ sudo mv empty.tar.gz /srv/chroot/unstable-amd64.tar.gz
$ sudo chown root:root /srv/chroot/unstable-amd64.tar.gz
$ schroot -c chroot:unstable-amd64-sbuild --begin-session
E: 15binfmt: update-binfmts: unable to open 
/var/run/schroot/mount/unstable-amd64-sbuild-ca29d966-e3e4-4196-b824-7e153b317c1d/bin/sh:
 No such file or directory
E: 20copyfiles: cp: cannot create regular file 
'/var/run/schroot/mount/unstable-amd64-sbuild-ca29d966-e3e4-4196-b824-7e153b317c1d/etc/resolv.conf':
 No such file or directory
E: unstable-amd64-sbuild-ca29d966-e3e4-4196-b824-7e153b317c1d: Chroot setup 
failed: stage=setup-start
$ mount | grep /run/schroot/mount/
tmpfs on 
/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb 
type tmpfs (rw,nosuid,nodev,relatime,size=8388608k)
proc on 
/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/var/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/proc
 type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on 
/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/var/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/sys
 type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on 
/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/var/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/dev
 type devtmpfs (rw,relatime,size=10240k,nr_inodes=1497603,mode=755)
devpts on 
/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/var/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/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)
tmpfs on 
/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/var/run/schroot/mount/unstable-amd64-sbuild-3aab5ea7-86ae-4c30-b096-d58406f025bb/dev/shm
 type tmpfs (rw,relatime)



Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to