Bug 317721

Summary: mount/umount need improvement
Product: [Retired] Fedora Hosted Projects Reporter: BJ Dierkes <derks>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: dcantrell, derks
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.9.7-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-07 21:32:30 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 BJ Dierkes 2007-10-04 02:35:12 UTC
In response to:

Bugzilla Bug 236428: RFE: Please bind mount host /dev to chroot/dev



Description of problem:

Often times mock exits without properly umounting one or all of /dev, /devpts,
and /proc (which are bind mounted from the host).  Once mock re-issues a 'clean'
for that same chroot it completely kills the host systems /dev, /devpts, and /proc.


Version-Release number of selected component (if applicable):

0.7.6, presumably since 0.7.1 when bind mounting was introduced.


How reproducible:


Steps to Reproduce:
1. Initiate a rebuild
2. Exit dirty (say... CTRL-C)

... do so until you have the host bind mounts lingering around.

3. Re-initiate the same build (i.e. use the same chroot
  

Actual results:

The hosts /dev, /dev/pts, /proc are effected by 'clean' (rm -rf /path/to/chroot).


Expected results:

The 'clean' method should properly *ensure* that the mount points are indeed
unmounted.  If it can't guarantee that, then it shouldn't proceed with cleaning
the chroot.


Additional info:

Comment 1 BJ Dierkes 2007-10-04 19:05:46 UTC
Related: https://bugzilla.redhat.com/show_bug.cgi?id=250985

Comment 2 BJ Dierkes 2007-10-04 20:40:25 UTC
Patch submitted in BZ 250985 to properly umount '/dev'.  The issue as described
above is not entirely accurate, as the issue does not necessarily stem from Mock
not handling a TERM signal.  

The overall issue is if clean() is called on a chroot that still has bind mounts
from the host (for this bug).

Comment 3 Clark Williams 2008-03-07 21:32:30 UTC
This was one of the major topics addressed in the great rewrite that happened
around 0.8+., where a lot of effort went into ensuring that the bind mounts were
cleaned up on exit. 

Closing for now...