Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 626283

Summary: edit-livecd clean up code failed
Product: Red Hat Enterprise Linux 6 Reporter: Qixiang Wan <qwan>
Component: livecd-toolsAssignee: Brian Lane <bcl>
Status: CLOSED CURRENTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: apevec, atodorov, bruno, cpelland, mburns, mshao, ovirt-maint, rwilliam, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: livecd-tools-031-5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-29 17:21:25 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:
Bug Depends On:    
Bug Blocks: 707622    

Description Qixiang Wan 2010-08-23 05:17:09 UTC
Description of problem:
edit-livecd will try to clean up the mount points and temporary files (will it be?), this will failed and leave lots of files in /var/tmp directory.

Version-Release number of selected component (if applicable):
livecd-tools-031-1.7.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. $ edit-livecd -s=/root/null.sh /root/rhev/rhev-hypervisor.iso
mount: block device /dev/loop1 is write-protected, mounting read-only
Running edit script '=/root/null.sh'
umount: /var/tmp/edit-livecd-u7Phxa/install_root: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
/usr/lib/python2.6/site-packages/imgcreate/errors.py:40: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  return str(self.message)
Traceback (most recent call last):
  File "/usr/bin/edit-livecd", line 339, in <module>
    sys.exit(main())
  File "/usr/bin/edit-livecd", line 333, in main
    editor.cleanup()
  File "/usr/lib/python2.6/site-packages/imgcreate/creator.py", line 570, in cleanup
    self.unmount()
  File "/usr/lib/python2.6/site-packages/imgcreate/creator.py", line 548, in unmount
    self._unmount_instroot()
  File "/usr/lib/python2.6/site-packages/imgcreate/live.py", line 191, in _unmount_instroot
    LoopImageCreator._unmount_instroot(self)
  File "/usr/lib/python2.6/site-packages/imgcreate/creator.py", line 937, in _unmount_instroot
    self.__instloop.cleanup()
  File "/usr/lib/python2.6/site-packages/imgcreate/fs.py", line 346, in cleanup
    Mount.cleanup(self)
  File "/usr/lib/python2.6/site-packages/imgcreate/fs.py", line 325, in cleanup
    self.unmount()
  File "/usr/lib/python2.6/site-packages/imgcreate/fs.py", line 356, in unmount
    raise MountError("Unable to unmount filesystem at %s" % self.mountdir)
imgcreate.errors.MountError: Unable to unmount filesystem at /var/tmp/edit-livecd-u7Phxa/install_root
umount: /var/tmp/edit-livecd-u7Phxa/install_root: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
Exception imgcreate.errors.MountError: MountError('Unable to unmount filesystem at /var/tmp/edit-livecd-u7Phxa/install_root',) in <bound method LiveImageEditor.__del__ of <__main__.LiveImageEditor object at 0x134dd90>> ignored

$ mount
/dev/mapper/vg_dhcp668393-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/vda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/loop0 on /var/tmp/edit-livecd-u7Phxa/install_root type ext2 (rw)

$ fuser -m /var/tmp/edit-livecd-u7Phxa/install_root

$ lsof /var/tmp/edit-livecd-u7Phxa/install_root

$ umount /var/tmp/edit-livecd-u7Phxa/install_root

$ mount 
/dev/mapper/vg_dhcp668393-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/vda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

$ losetup -a
/dev/loop0: [fd00]:161978 (/var/tmp/edit-livecd-u7Phxa/ex/ext3fs.img)

$ losetup -d /dev/loop0 

  
Actual results:
failed to umount some directories, and leave the temporary files in /var/tmp

Expected results:
clean up code should work

Additional info:

Comment 2 Qixiang Wan 2010-08-23 08:06:49 UTC
this is caused by the error command line : -s=/root/null.sh

edit-livecd help may mislead users to specify a wrong command lines:
$ edit-livecd --help
Usage: edit-livecd [-s=<script.sh>] <LIVECD.iso>

this make it trigger a exception in:
(/usr/bin/edit-livecd) 321	            editor._run_script(options.script)

and go to:
(/usr/bin/edit-livecd) 334	    finally:
(/usr/bin/edit-livecd) 335	        editor.cleanup()

it's not the problem originally reported, just need to change the help info.

Comment 3 RHEL Program Management 2011-01-07 15:59:25 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 6 RHEL Program Management 2012-01-03 19:50:16 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.