vmbuilder leaves chroot in /tmp on crash

Bug #592236 reported by Gunnar Thielebein
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
VMBuilder
New
Undecided
Unassigned

Bug Description

When an error appears vmbuilder interrupts immidiately and leaves the chroot dir in its current state in /tmp.
This can cause serious issue if /dev is still bind-mounted and you try to remove the chroot environment
with something like rm -rf /tmp/tmpXXX/* . This would remove some of the /dev/ entries and renders your installation to fail on next boot.

The best Enhancement would be if vmbuilder hook any errors by default and would always cleanly umount binds and remove temporary created chroot also in failure situations.

Workaround for now:

$ umount /tmp/tmp*/dev/pts
$ umount /tmp/tmp*/dev
$ umount /tmp/tmp*/proc
$ umount /tmp/tmp*
$ umount /tmp/tmp*

In case of something like this:

$mount
...
/tmp/tmpl2EVVR/tmp/vmbuilder-grub/tmpmtDSK6
...

$ umount /tmp/tmp*/tmp/vmbuilder-grub/*

Revision history for this message
Rafal-maj-it (rafal-maj-it) wrote :

also --tmp option is not working, it says the option is not known.

Revision history for this message
Chris R. Jones (chris-rassalon) wrote :

There's a little bit of value in having the tmp files remain. In many cases, the installation failed because of some operator error (for instance my --execscript failed). And if the chroot dir is left in the state it was in when it failed I can troubleshoot the error by chrooting in and re-executing the steps that failed.

But it does seem like vmbuilder ought to at least report the location of the files to the user and raise their attention to the problem. And yes, leaving things mounted makes things problematic -- you can't easily remove the tmp directory without knowing what you're doing.

Maybe only leave the files if --debug option was used. And even then , the same concerns above apply.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.