Bug 769680 - temporary directories created during appliance builds are not cleaned up on error
Summary: temporary directories created during appliance builds are not cleaned up on e...
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2011-12-21 17:43 UTC by Stefan Hajnoczi
Modified: 2011-12-24 03:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-12-23 13:34:14 UTC

Attachments (Terms of Use)

Description Stefan Hajnoczi 2011-12-21 17:43:45 UTC
Description of problem:

A machine that I have access too had 38 temporary directories in /var/tmp/guestfs-XXXXXX, where each temporary directory has a unique name.  The directory contained initrd and root images as well as a symlink to the /boot/vmlinuz-* kernel.

Richard Jones suggested that the temporary directory created in src/appliance.c: build_supermin_appliance() is not cleaned up in all error paths.  Additionally, if febootstrap-supermin-helper exits with an error it might not be cleaned up.

The impact of this bug is that disk space is wasted by temporary directories.

Version-Release number of selected component (if applicable):

libguestfs0 1.12.9-2 Debian package

How reproducible:

I do not know how to reproduce the bug but the temporary directories in /var/tmp had been created over a period of weeks and months.

Actual results:

Temporary appliance directories are left over in /var/tmp/guestfs-XXXXXX.

Expected results:

At most one appliance should be cached on the host system.  Temporary directories should be cleaned up.

Comment 1 Richard W.M. Jones 2011-12-23 10:39:15 UTC
Patches posted:

If tests complete OK, I will push these upstream.

Comment 2 Richard W.M. Jones 2011-12-23 13:34:14 UTC
Passes all of 'make check' and 'make extra-tests' so I'm
going to push this in 1.15.14.

Comment 3 Wanlong Gao 2011-12-24 03:34:15 UTC
I have tested for many times and the /var/tmp/guestfs.XXXXXX can always been cleaned now, I think guestfs___remove_tmpdir can do the right thing except some
specific conditions.

Good luck!

-Wanlong Gao

Note You need to log in before you can comment on or make changes to this bug.