Bug 239002

Summary: Eject command
Product: Red Hat Enterprise Linux 5 Reporter: Ian Nicholls <ian.a.nicholls>
Component: anacondaAssignee: Chris Lumens <clumens>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: medium    
Version: 5.0CC: bschneiders, fmalita, madko
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-04 15:03:13 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 Ian Nicholls 2007-05-04 12:44:24 UTC
In dispatch.py (version not sure but RHEL5/CentOS5) order is 

   ("methodcomplete", doMethodComplete, ),
    ("dopostaction", doPostAction, ),

It was previously up until the RHEL 5 beta

    ("dopostaction", doPostAction, ),
    ("methodcomplete", doMethodComplete, ),

This means the cd is ejected before the %post section is run meaning there is no
access to any files on the CD!!

Comment 1 Chris Lumens 2007-05-04 15:03:13 UTC
This will be fixed in rawhide and in a future update release of RHEL5.  Thanks
for the bug report.

Comment 2 Edouard Bourguignon 2008-02-28 08:48:05 UTC
is it now fixed? I've just looked inside the dispatch.py and dopostaction() is
still after methodcomplete()

Comment 3 Chris Lumens 2008-02-28 15:22:48 UTC
This will be fixed in RHEL5.2.

Comment 4 Edouard Bourguignon 2008-02-29 07:55:14 UTC
thanks for the information
I will patch and rebuild anaconda until then.

Comment 5 Florin Malita 2008-08-18 19:18:43 UTC
The issue is still present in RHEL5.2. What's going on?

Comment 6 Edouard Bourguignon 2008-08-19 06:36:28 UTC
It seems that the doMethodComplete function checks if the ks option was among the boot parameters and only ejects the CD/DVD if anaconda is not kickstarted.

In installmethod.py:

# This handles any cleanup needed for the method.  It occurs *very* late
# and is mainly used for unmounting media and ejecting the CD.  If we're on
# a kickstart install, don't eject the CD since there's a command to do that
# if the user wants.
def doMethodComplete(anaconda):
    anaconda.method.filesDone()

    if not anaconda.isKickstart:
        anaconda.method.ejectCD()

I haven't tried yet.

Comment 7 Florin Malita 2008-08-19 15:25:01 UTC
OK, I should have noticed this bug is related strictly to the CD *eject*. My issue is with the unmounting /mnt/source before %post (performed unconditionally in filesDone()).

While it is obviously possible to remount, it's an unnecessary hassle when dealing with media-agnostic scripts (we need to support CDROM & NFS kickstarts). It's actually easier to keep the mount point busy and cause the umount command to fail, but I would rather have a clean solution instead of playing such games with anaconda.

Is there any good reason for unmounting /mnt/source before %post?