File 0629-shutdown-sleep-a-little-if-a-process-was-killed.patch of Package dracut.18204
From c5e715ef104b2f8e5609c7fa47d452c92426d989 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 15 May 2018 13:37:53 +0200
Subject: [PATCH 1/2] shutdown: sleep a little, if a process was killed
If a process (maybe plymouth) was still pinning /oldroot, then shutdown
would
- kill -9 $pid
- umount_a
- umount_a
in a very short timeframe. A small sleep hopefully lets the scheduler free
up /oldroot in the mean time.
---
modules.d/99shutdown/module-setup.sh | 2 +-
modules.d/99shutdown/shutdown.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh
index 5cb3594a8..dfd6caa20 100755
--- a/modules.d/99shutdown/module-setup.sh
+++ b/modules.d/99shutdown/module-setup.sh
@@ -14,7 +14,7 @@ depends() {
# called by dracut
install() {
local _d
- inst_multiple umount poweroff reboot halt losetup stat
+ inst_multiple umount poweroff reboot halt losetup stat sleep
inst_multiple -o kexec
inst "$moddir/shutdown.sh" "$prefix/shutdown"
[ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib
diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh
index 918a8a4f1..f21cc811b 100755
--- a/modules.d/99shutdown/shutdown.sh
+++ b/modules.d/99shutdown/shutdown.sh
@@ -38,7 +38,7 @@ source_hook pre-shutdown
warn "Killing all remaining processes"
-killall_proc_mountpoint /oldroot
+killall_proc_mountpoint /oldroot || sleep 0.2
umount_a() {
local _did_umount="n"
--
2.31.1