Red Hat Bugzilla – Bug 1298355
kickstart stuck at "Reached Target Shutdown" stage when removing media before shutdown completes
Last modified: 2017-08-01 05:09:52 EDT
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
Steps to Reproduce:
1. Complete kickstart installation
2. As system is beginning the reboot process, eject the ISO/DVD
Halts at "Reached Target Shutdown"
System completes reboot, preventing bios from targeting CDROM drive as boot target
Customer is using VMWare
VMware boot screen delay is set to 0 seconds
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 ?
Joseph Koduvathra (1/22/2016 4:42 PM)
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.
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:
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.
Can someone confirm if a fix is available yet ? how is RHEL7.3 ? Unfortunately I am not allowed to open github at my workplace.
qa acking for 7.4
(In reply to Branislav Blaškovič from comment #11)
> qa acking for 7.4
I believe the same bug happens for Atomic Hosts after prelonged time of running Docker containers.
fix merged to upstream staging branch ->
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.
> In previous RedHat versions (up to 6) swapoff was never called during
I don't think that is true:
That is "halt"
Nevertheless. Is it necessary to call swapoff? And why?
It should be safe to halt the system without calling swapoff.
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.
*** Bug 1379268 has been marked as a duplicate of this bug. ***
Still not fixed. https://bugzilla.redhat.com/show_bug.cgi?id=1379268 marked falsely as a duplicate.
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.