[buildd-tools-devel] Bug#600966: Bug#600966: Bug#600966: Leaves behind empty dirs in /var/lib/schroot/mount with type=file
Roger Leigh
rleigh at codelibre.net
Fri Oct 22 11:35:21 UTC 2010
On Fri, Oct 22, 2010 at 01:04:40PM +0200, Loïc Minier wrote:
> On Fri, Oct 22, 2010, Roger Leigh wrote:
> > Could you possibly run with "schroot --verbose --debug=notice …"
> > so I can see what's getting run (or not run?)
>
> Attaching a slightly anonymized log of schroot -c foo true >schroot.log
> 2>&1.
Thanks. Looks OK to me. The environment is correct, so should be
working as expected. The cleanup code is this shell script:
elif [ "$STAGE" = "setup-stop" ]; then
if [ "$STATUS" = "ok" ] && [ "$CHROOT_FILE_REPACK" = "true" ]; then
if [ -d "$UNPACK_LOCATION" ]; then
info "Repacking chroot archive file $CHROOT_FILE from $UNPACK_LOCATION"
cd "$UNPACK_LOCATION" && repack_file
else
warn "Not repacking chroot archive file: $UNPACK_LOCATION does not exist (it may have been removed previously)"
fi
fi
if [ "$CHROOT_SESSION_PURGE" = "true" ]; then
info "Purging $UNPACK_LOCATION"
if [ -d "$UNPACK_LOCATION" ]; then
rm -rf "$UNPACK_LOCATION"
fi
fi
We see:
I: Executing ‘05file setup-stop ok’
I: 05file: Purging /var/lib/schroot/unpack/foo-2dd6d49a-5fa5-442d-90f2-e70a9dd78c2e
so the cleanup code is genuinely being run.
I think the issue here is that we are only purging the content of
/var/lib/schroot/unpack and skipping /var/lib/schroot/mount
(which is deliberately omitted in the 10mount setup script).
If you edit /etc/schroot/setup.d/10mount:
# Purge mount location.
# The contents of file chroots are purged separately, because
# we might want to repack the contents.
if [ "$CHROOT_TYPE" != "file" ]; then
if echo "$CHROOT_MOUNT_LOCATION" | grep -q "^$MOUNT_DIR/"; then
if [ -d "$CHROOT_MOUNT_LOCATION" ]; then
rmdir "$CHROOT_MOUNT_LOCATION"
fi
fi
fi
and remove the "if [ "$CHROOT_TYPE" != "file" ]; then" and "fi" at the end of
that block so it's always run, do you see correct purging then?
I think this is probably just a simple omission: we used to unpack directly
into the mount directory, and now we bind mount, so the special treatment
of file chroots is now redundant (and leaves stray directories).
Thanks,
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: 197 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20101022/70669510/attachment.pgp>
More information about the Buildd-tools-devel
mailing list