Bug 1298355 - kickstart stuck at "Reached Target Shutdown" stage when removing media before shutdown completes
kickstart stuck at "Reached Target Shutdown" stage when removing media before...
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd (Show other bugs)
x86_64 Linux
urgent Severity high
: rc
: ---
Assigned To: systemd-maint
Branislav Blaškovič
: ZStream
: 1379268 (view as bug list)
Depends On:
Blocks: 74systemd 1421712
  Show dependency treegraph
Reported: 2016-01-13 16:39 EST by jcastran
Modified: 2017-08-01 05:09 EDT (History)
15 users (show)

See Also:
Fixed In Version: systemd-219-31.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1421712 (view as bug list)
Last Closed: 2017-08-01 05:09:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description jcastran 2016-01-13 16:39:04 EST
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:

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 08:06:00 EST
Customer Comment/Request:


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)
Comment 7 Mauro Mozzarelli 2016-10-29 08:36:36 EDT
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 12:03:53 EDT
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.
Comment 9 Lukáš Nykrýn 2016-11-10 07:40:49 EST
Comment 10 Joseph Biju Koduvathra 2016-11-10 10:36:13 EST
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 07:04:12 EST
qa acking for 7.4
Comment 12 Joseph Biju Koduvathra 2016-11-11 07:38:55 EST
(In reply to Branislav Blaškovič from comment #11)
> qa acking for 7.4

Thank you.
Comment 13 Jakub Rączkowski 2016-11-17 04:40:16 EST
I believe the same bug happens for Atomic Hosts after prelonged time of running Docker containers.
Comment 17 Mauro Mozzarelli 2017-01-11 09:34:59 EST
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 10:50:34 EST
> In previous RedHat versions (up to 6) swapoff was never called during
> shutdown/reboot.

I don't think that is true:
Comment 19 Mauro Mozzarelli 2017-01-11 13:50:18 EST
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 15:11:01 EST
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 02:44:14 EST
*** Bug 1379268 has been marked as a duplicate of this bug. ***
Comment 26 thierry.laurion 2017-04-13 11:39:48 EDT
Still not fixed. https://bugzilla.redhat.com/show_bug.cgi?id=1379268 marked falsely as a duplicate.
Comment 31 errata-xmlrpc 2017-08-01 05:09:52 EDT
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.


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