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 1298355 - kickstart stuck at "Reached Target Shutdown" stage when removing media before shutdown completes
Summary: kickstart stuck at "Reached Target Shutdown" stage when removing media before...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: x86_64
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: Branislav Blaškovič
URL:
Whiteboard:
: 1379268 (view as bug list)
Depends On:
Blocks: 74systemd 1421712
TreeView+ depends on / blocked
 
Reported: 2016-01-13 21:39 UTC by jcastran
Modified: 2021-06-10 11:06 UTC (History)
15 users (show)

Fixed In Version: systemd-219-31.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1421712 (view as bug list)
Environment:
Last Closed: 2017-08-01 09:09:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2297 0 normal SHIPPED_LIVE systemd bug fix and enhancement update 2017-08-01 12:40:16 UTC

Description jcastran 2016-01-13 21:39:04 UTC
Description of problem:
Rhel 7.2 will not complete shutdown. Halts at "Reached Target Shutdown"
Customer has previously used this method for RHEL 5,6,7,7.1 but now if you manually eject the DVD before the shutdown is complete, the system will hang attempting to unmount media that is already gone.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7.2

How reproducible:
Everytime

Steps to Reproduce:
1. Complete kickstart installation
2. As system is beginning the reboot process, eject the ISO/DVD

Actual results:
Halts at "Reached Target Shutdown"

Expected results:
System completes reboot, preventing bios from targeting CDROM drive as boot target

Additional info:
Customer is using VMWare
VMware boot screen delay is set to 0 seconds

Comment 2 jcastran 2016-01-24 13:06:00 UTC
Customer Comment/Request:

Hello,

As discussed, we have been using the procedure of disconnecting the DVD image before reboot in RHEL5/6 and even in RHEL7.1. If we cannot get the same procedure working in RHEL7.2 we will have to make lot of changes in build process and the standards followed in VM creation. If it's a matter of very limited number of servers workaround's are fine. But when it comes to huge number of servers and changing process and procedures followed by different team, it makes it very complicated. What I am requesting is to find what behavior is changed from RHEL7.1 to 7.2 and is that a customizable parameter ?

Thanks.
 Joseph Koduvathra  (1/22/2016 4:42 PM)

Comment 7 Mauro Mozzarelli 2016-10-29 12:36:36 UTC
I have exactly the same problem. VM Shutdown and Reboot stop at:

[ OK ] Stopped Remount Root and Kernel Filesystems.
       Stopping Remount Root and Kernel Filesystems...
[ OK ] Reached Target Shutdown

However there is no DVD or any other media involved, thus it does not depend just on media removal as reported above.

After the last message the VM hangs and fails to shutdown or reboot requiring manual intervention.

This should be considered a "blocking" bug as it impacts essential server automation.

Comment 8 Mauro Mozzarelli 2016-10-29 16:03:53 UTC
After further investigation I found that:
- systemd hangs on shutdown/reboot when there is a tmpfs filesystem.
- By removing every tmpfs filesystem it no longer hangs.

This is because systemd runs swapoff (remove all swaps) before tmpfs are unmounted and this causes the system to hang.


A fix is available in systemd 229:

https://github.com/systemd/systemd/issues/1902
Swap units are deactivated too early

This is linked to Bug 1031158

As this affects system operations and availability (remote VMs hang when rebooted and require manual intervention) I recommend to raise the priority to HIGH.

Comment 9 Lukáš Nykrýn 2016-11-10 12:40:49 UTC
https://github.com/lnykryn/systemd-rhel/pull/66

Comment 10 Joseph Biju Koduvathra 2016-11-10 15:36:13 UTC
Can someone confirm if a fix is available yet ? how is RHEL7.3 ?  Unfortunately I am not allowed to open github at my workplace.

Comment 11 Branislav Blaškovič 2016-11-11 12:04:12 UTC
qa acking for 7.4

Comment 12 Joseph Biju Koduvathra 2016-11-11 12:38:55 UTC
(In reply to Branislav Blaškovič from comment #11)
> qa acking for 7.4

Thank you.

Comment 13 Jakub Rączkowski 2016-11-17 09:40:16 UTC
I believe the same bug happens for Atomic Hosts after prelonged time of running Docker containers.

Comment 17 Mauro Mozzarelli 2017-01-11 14:34:59 UTC
The change proposed in Comment 14, although necessary, does not resolve the problem (already tried).

The issue occurs whether there is a tmpfs mounted or not. Having a tmpfs mounted only exacerbates the problem because the system runs out of physical memory earlier and consistently when the swap is turned off, for example on a Virtual Machine that has a small amount of "physical" memory allocated.

The issue occurs because during the shutdown/reboot process systemd calls swapoff that attempts to remove every swap device.

If there isn't sufficient physical memory to hold what was being held in the swap area, then the system hangs indefinitely.

In previous RedHat versions (up to 6) swapoff was never called during shutdown/reboot.

I wonder what has changed in RHEL 7 that now requires a swapoff. Couldn't we just do without and solve the problem? After all it should not be necessary to "remove" memory to shutdown a system.

Comment 18 Lukáš Nykrýn 2017-01-11 15:50:34 UTC
> In previous RedHat versions (up to 6) swapoff was never called during
> shutdown/reboot.
> 

I don't think that is true:
https://github.com/fedora-sysv/initscripts/blob/rhel6-branch/rc.d/init.d/halt#L117

Comment 19 Mauro Mozzarelli 2017-01-11 18:50:18 UTC
That is "halt"

Nevertheless. Is it necessary to call swapoff? And why?
It should be safe to halt the system without calling swapoff.

Comment 20 Lukáš Nykrýn 2017-01-11 20:11:01 UTC
For example you can use a swap file instead of partition. Then you need to call swapoff first otherwise you won't be able to unmount the partition, where the swap file is stored.

Comment 21 Jan Synacek 2017-01-13 07:44:14 UTC
*** Bug 1379268 has been marked as a duplicate of this bug. ***

Comment 26 thierry.laurion 2017-04-13 15:39:48 UTC
Still not fixed. https://bugzilla.redhat.com/show_bug.cgi?id=1379268 marked falsely as a duplicate.

Comment 31 errata-xmlrpc 2017-08-01 09:09:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2297


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