Bug 502545 - killing livecd-creator leaves /var/tmp/imgcreate-rjmEfO/install_root
killing livecd-creator leaves /var/tmp/imgcreate-rjmEfO/install_root
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: livecd-tools (Show other bugs)
12
All Linux
high Severity high
: ---
: ---
Assigned To: David Huff
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-25 23:42 EDT by Jens Petersen
Modified: 2010-09-15 23:47 EDT (History)
9 users (show)

See Also:
Fixed In Version: livecd-tools-034-7.fc14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-09-15 23:47:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jens Petersen 2009-05-25 23:42:49 EDT
Description of problem:
If one changes one's mind and interrupts a livecd-creator run
it stops but leaves behind a mounted install_root.

How reproducible:
every time

Steps to Reproduce:
1. run livecd-creator
2. Press Ctrl-c
  
Actual results:
# df | grep loop
/dev/loop0             4128448    140664   3945844   4% /var/tmp/imgcreate-rjmEfO/install_root

Expected results:
loop mount to be unmounted before exit

Additional info:
The worse thing is that this forces the need to power-cycle when rebooting since usually the machine is not able to shutdown because of the hanging mountpoint.

This has been happening for a long time.
Comment 1 Jeremy Katz 2009-05-26 10:30:37 EDT
The signal is caught deep in rpm so there's little we can do.  

We have a general catch-all exception handler that would be getting used if it could to clean up
Comment 2 Jens Petersen 2009-05-26 20:23:59 EDT
Ok, I see - any hints about how to unmount those loop devices by hand afterwards?  They always say they are busy...
Comment 3 Jeremy Katz 2009-05-26 21:04:30 EDT
If all the processes are dead, then they should unmount and detach the loopdev.

The cleanup script I wrote at one point (before the catchall handler ;) just does something like
  for d in $(cat /proc/mounts  |grep imgcreate |awk {'print $2;'}) ; do umount -fl $d 2>/dev/null ; done

a few times
Comment 4 Jeff Johnson 2009-05-29 07:50:40 EDT
Re comment #1:

The signal is caught by rpm and mapped into an exported symbol that can be tested
whenever you choose.
Comment 5 Bug Zapper 2009-06-09 12:33:07 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Jens Petersen 2009-11-30 04:00:07 EST
So back to livecd-tools?
Comment 7 Panu Matilainen 2010-01-08 07:44:12 EST
Back to livecd-tools. It's possible to poll for signals caught by rpm with rpm.signalsCaught(). Alternatively you can just set your own SIGINT handler before rpm does, rpm wont touch handlers which are set to non-default. When operating on a real, live system overriding rpm's signal handler is not a very good idea but as livecd-tools is just creating a system image into a chroot, rpmdb consistency when interrupted is hardly an issue.
Comment 8 Fedora Admin XMLRPC Client 2010-05-07 11:40:58 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 9 Jasper O'neal Hartline 2010-08-04 04:46:44 EDT
In reply to comment 4
I have done some testing, and since the rpm.checkSignals()
happens after every package, after say hitting ctrl-C in miscutils.py
sys.exit(1) happens. 

How are you suggesting to use rpm.signalsCaught() or rpm.checkSignals() to gracefully cleanup in livecd-creator if it exits?

So far the only way I have been able to avoid this RPMN behaviour is by initializing my own signal handler, before RPM does.

Do you have a better suggestion?
Comment 10 Fedora Update System 2010-09-12 00:19:01 EDT
livecd-tools-034-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/livecd-tools-034-1.fc14
Comment 11 Fedora Update System 2010-09-13 14:08:44 EDT
livecd-tools-034-2.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update livecd-tools'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/livecd-tools-034-2.fc14
Comment 12 Fedora Update System 2010-09-14 23:21:47 EDT
livecd-tools-034-7.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/livecd-tools-034-7.fc14
Comment 13 Fedora Update System 2010-09-15 02:51:07 EDT
livecd-tools-034-7.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update livecd-tools'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/livecd-tools-034-7.fc14
Comment 14 Fedora Update System 2010-09-15 23:45:53 EDT
livecd-tools-034-7.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

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