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 1191386 - [atomic] DVD is not ejected when reboot --eject specified in kickstart
Summary: [atomic] DVD is not ejected when reboot --eject specified in kickstart
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda
Version: 7.1
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Colin Walters
QA Contact: Ladislav Jozsa
URL:
Whiteboard:
Depends On:
Blocks: 1147383 1473733 1477664
TreeView+ depends on / blocked
 
Reported: 2015-02-11 08:46 UTC by Ladislav Jozsa
Modified: 2023-03-24 13:30 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-21 14:14:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
anaconda.ifcfg.log (1.09 KB, text/plain)
2015-02-11 08:46 UTC, Ladislav Jozsa
no flags Details
anaconda-ks.cfg (1.46 KB, text/plain)
2015-02-11 08:46 UTC, Ladislav Jozsa
no flags Details
anaconda.log (10.78 KB, text/plain)
2015-02-11 08:46 UTC, Ladislav Jozsa
no flags Details
anaconda.program.log (43.15 KB, text/plain)
2015-02-11 08:46 UTC, Ladislav Jozsa
no flags Details
anaconda.storage.log (136.15 KB, text/plain)
2015-02-11 08:46 UTC, Ladislav Jozsa
no flags Details
anaconda.xlog (34.79 KB, text/plain)
2015-02-11 08:46 UTC, Ladislav Jozsa
no flags Details
syslog (110.22 KB, text/plain)
2015-02-11 08:47 UTC, Ladislav Jozsa
no flags Details
File installation_logs_no_options.tar (1.22 MB, application/x-gzip)
2018-03-01 05:08 UTC, Supreet
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 949919 0 unspecified CLOSED Don't eject CD drive when the installer doesn't run from it 2021-02-22 00:41:40 UTC

Internal Links: 949919

Description Ladislav Jozsa 2015-02-11 08:46:30 UTC
Description of problem:
After finishing kickstart installation of RHEL Atomic Host, DVD is not ejected even if 'reboot --eject' is specified in the kickstart file.

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

How reproducible:
always

Steps to Reproduce:
1. Start RHEL Atomic Host installation
2. Use attached kickstart


Actual results:
DVD not ejected after finishing installation

Expected results:
DVD ejected

Additional info:

Comment 1 Ladislav Jozsa 2015-02-11 08:46:46 UTC
Created attachment 990384 [details]
anaconda.ifcfg.log

Comment 2 Ladislav Jozsa 2015-02-11 08:46:48 UTC
Created attachment 990385 [details]
anaconda-ks.cfg

Comment 3 Ladislav Jozsa 2015-02-11 08:46:50 UTC
Created attachment 990386 [details]
anaconda.log

Comment 4 Ladislav Jozsa 2015-02-11 08:46:53 UTC
Created attachment 990387 [details]
anaconda.program.log

Comment 5 Ladislav Jozsa 2015-02-11 08:46:56 UTC
Created attachment 990388 [details]
anaconda.storage.log

Comment 6 Ladislav Jozsa 2015-02-11 08:46:58 UTC
Created attachment 990389 [details]
anaconda.xlog

Comment 7 Ladislav Jozsa 2015-02-11 08:47:06 UTC
Created attachment 990390 [details]
syslog

Comment 21 Radek Vykydal 2017-08-08 11:45:27 UTC
Yes, this is expected, actually anaconda ejects cdrom devices that were mounted during installation which includes DVD used for installation but apparently doesn't include the ISO customer is using for intial boot (See also bug 949919).

Given the ISO is not mounted and used by installer process it should be possible to just use "eject <DEVNAME>" command (or just "eject" which will use "/dev/cdrom") in %post section of kickstart.

Comment 22 Joe Wright 2017-09-01 14:46:10 UTC
According to a customer, ejecting the disk in a postinstall script does not work either.

Comment 23 Joe Wright 2017-09-01 14:47:41 UTC
Also this was reproduced on 7.4 on bare metal

Comment 24 Joe Wright 2017-09-01 14:48:49 UTC
Also Vmware

Comment 25 Jan Stodola 2017-09-01 15:30:54 UTC
Joe, could you attach the installation logs? They are in /tmp/ during the installation or in /var/log/anaconda/ on installed system. Kickstart file would help as well.
Thanks

Comment 27 Joe Wright 2017-09-06 14:51:31 UTC
Attached

Comment 33 Nate Revo 2018-01-08 20:08:30 UTC
With a client who is experiencing this issue on VMWare.  Has a resolution been found? 

Just to clarify, "reboot --eject" in the kickstart does not work and neither does the "eject /dev/name" in the %post section.

Comment 35 Shane Seymour 2018-01-16 23:42:44 UTC
Sorry for butting in, but did anyone try eject -i 0 (unlock the tray) before eject /dev/name in %post in case the tray was left locked by something?

Comment 38 Nate Revo 2018-02-12 17:51:59 UTC
(In reply to Shane Seymour from comment #35)
> Sorry for butting in, but did anyone try eject -i 0 (unlock the tray) before
> eject /dev/name in %post in case the tray was left locked by something?

Yes.  doing an `eject -i 0` allows the `reboot --eject` to work.  However, `reboot --eject` worked in the past without the tray unlock step.  Seems the behavior of `reboot --eject` has changed.

Comment 39 Shane Seymour 2018-02-12 23:24:11 UTC
(In reply to Nate Revo from comment #38)
> 
> Seems the behavior of `reboot --eject` has changed.

I thought that the kernel will lock the tray when the DVD is open for data access (and unlock it when there are no more opens left). Is there any chance that it could still be open at the time you're attempting to do the eject? If it is then it won't be able to eject it.

drivers/cdrom/cdrom.c

1027 static
1028 int open_for_data(struct cdrom_device_info * cdi)
1029 {
...
1113         if (CDROM_CAN(CDC_LOCK) && (cdi->options & CDO_LOCK)) {
1114                         cdo->lock_door(cdi, 1);
1115                         cdinfo(CD_OPEN, "door locked.\n");
1116         }
1117         cdinfo(CD_OPEN, "device opened successfully.\n"); 
1118         return ret;
...

I'd suggest turning on debug output (cdrom.debug=1) from the cdrom driver to catch the tray being locked - if the driver is locking it and never unlocking it you'd see the above message without any message about unlocking it (I believe it should get unlocked when all closes have been done). I've no idea how verbose the output will be.

In a worst case situation test booting with cdrom.lockdoor=0 on the kernel command line to see if preventing the driver from locking the door sheds any light on the situation. That will show if something other than the kernel is locking the tray.

Comment 41 Supreet 2018-03-01 05:08:58 UTC
Created attachment 1402220 [details]
File installation_logs_no_options.tar

Comment 44 Jan Stodola 2018-03-01 09:42:36 UTC
Supreet,
thanks for the logs. It looks like the customer doesn't use DVD as the installation source, but it's only used for booting.
Please, see comments 20 and 21 with a similar issue. RFE for ejecting DVD not used as the installation source is tracked separately in bug 1499792.

Comment 45 Chris Williams 2018-03-21 14:14:17 UTC
The original issue behind this BZ was `reboot --eject` not working in kickstart when you boot and install from optical media appears to have been addressed so I am closing this CURRENT RELEASE. 
Work will continue in BZ 1499792 which is an RFE for new functionality where `reboot --eject` will work when you boot but do not install from optical media.


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