Bug 769680 - temporary directories created during appliance builds are not cleaned up on error
temporary directories created during appliance builds are not cleaned up on e...
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
Depends On:
  Show dependency treegraph
Reported: 2011-12-21 12:43 EST by Stefan Hajnoczi
Modified: 2011-12-23 22:34 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-12-23 08:34:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stefan Hajnoczi 2011-12-21 12:43:45 EST
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 05:39:15 EST
Patches posted:

If tests complete OK, I will push these upstream.
Comment 2 Richard W.M. Jones 2011-12-23 08:34:14 EST
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-23 22:34:15 EST
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.