Bug 502545

Summary: killing livecd-creator leaves /var/tmp/imgcreate-rjmEfO/install_root
Product: [Fedora] Fedora Reporter: Jens Petersen <petersen>
Component: livecd-toolsAssignee: David Huff <dhuff>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 12CC: bruno, davidz, ffesti, Jasper.Hartline, jnovy, katzj, n3npq, pmatilai, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: livecd-tools-034-7.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-16 03:47:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jens Petersen 2009-05-26 03:42:49 UTC
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 14:30:37 UTC
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-27 00:23:59 UTC
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-27 01:04:30 UTC
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 11:50:40 UTC
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 16:33:07 UTC
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 09:00:07 UTC
So back to livecd-tools?

Comment 7 Panu Matilainen 2010-01-08 12:44:12 UTC
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 15:40:58 UTC
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 08:46:44 UTC
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 04:19:01 UTC
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 18:08:44 UTC
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-15 03:21:47 UTC
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 06:51:07 UTC
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-16 03:45:53 UTC
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.