Compare commits

...

2 Commits

Author SHA1 Message Date
Tao Liu 9c697743c3 Release 2.0.27-8 2024-01-31 02:33:57 +00:00
Lichen Liu 78e19be071 dracut-module-setup: Skip initrd-cleanup and initrd-parse-etc in kdump
Resolves: https://issues.redhat.com/browse/RHEL-13996
Upstream: Fedora
Conflict: None

commit 468336700df86b52cd673d68561ba460ff2390be
Author: Lichen Liu <lichliu@redhat.com>
Date:   Mon Jan 22 15:59:09 2024 +0800

    dracut-module-setup: Skip initrd-cleanup and initrd-parse-etc in kdump

    When using multipath devices as the target for kdump, if user_friendly_name
    is also specified, devices default to names like "mpath*", e.g., mpatha.
    In dracut, we obtain a persistent device name via get_persistent_dev. However,
    dracut currently believes using /dev/mapper/mpath* could cause issues, thus
    alternatively names are used, here it's /dev/disk/by-uuid/<FS_UUID>.

    During the kdump boot progress, the /dev/disk/by-uuid/<FS_UUID> will exist as
    soon as one of the path devices exists, but it won't be usable by systemd,
    since multipathd will claim that device as a path device. Then multipathd will
    get stopped before it can create the multipath device.

    Without user_friendly_name, /dev/mapper/<WWID> is considered a persistent
    device name, avoiding the issue.

    The exit of multipathd is due to two dependencies in the current dracut module
    90multipath/multipathd.service, "Before=initrd-cleanup.service" and
    "Conflicts=initrd-cleanup.service".

    As per man 5 systemd.unit, if A.service has "Conflicts=B.service", starting
    B.service will stop A.service.

    This is useful during normal boot. However, we will never switch-root after
    capturing vmcore in kdump.

    We need to ensure that multipathd is not killed due to such dependency issue.
    Without modifying multipathd.service, we add ConditionPathExists=!/proc/vmcore
    to skip initrd-cleanup.service in kdump. This approach is beneficial as
    it avoid the potential termination of other services that conflict with
    initrd-cleanup.service. Also skip initrd-parse-etc.service as it will try to
    start initrd-cleanup.service. Both of these services are used for switch root,
    so they can be safely skipped in kdump.

    Suggested-by: Benjamin Marzinski <bmarzins@redhat.com>
    Suggested-by: Dave Young <dyoung@redhat.com>
    Signed-off-by: Lichen Liu <lichliu@redhat.com>
    Reviewed-by: Philipp Rudo <prudo@redhat.com>

Signed-off-by: Lichen Liu <lichliu@redhat.com>
2024-01-24 15:51:18 +08:00
3 changed files with 16 additions and 1 deletions

3
.kexec-tools.metadata Normal file
View File

@ -0,0 +1,3 @@
80ac3f5e77d3c79883edadf14428734db4720009 eppic-e8844d3.tar.gz
ed15f191adee22ab0721ba62af1cae67eb981670 kexec-tools-2.0.27.tar.xz
98cae2b1062871905795918c32b6d46ccd115074 makedumpfile-1.7.4.tar.gz

View File

@ -1100,6 +1100,15 @@ install() {
's/\(^[[:space:]]*reserved_memory[[:space:]]*=\)[[:space:]]*[[:digit:]]*/\1 1024/' \
"${initdir}/etc/lvm/lvm.conf" &> /dev/null
# Skip initrd-cleanup.service and initrd-parse-etc.service becasue we don't
# need to switch root. Instead of removing them, we use ConditionPathExists
# to check if /proc/vmcore exists to determine if we are in kdump.
sed -i '/\[Unit\]/a ConditionPathExists=!\/proc\/vmcore' \
"${initdir}/${systemdsystemunitdir}/initrd-cleanup.service" &> /dev/null
sed -i '/\[Unit\]/a ConditionPathExists=!\/proc\/vmcore' \
"${initdir}/${systemdsystemunitdir}/initrd-parse-etc.service" &> /dev/null
# Save more memory by dropping switch root capability
dracut_no_switch_root
}

View File

@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.27
Release: 7%{?dist}
Release: 8%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@ -408,6 +408,9 @@ fi
%endif
%changelog
* Tue Jan 30 2024 Tao Liu <ltao@redhat.com> - 2.0.27-8
- dracut-module-setup: Skip initrd-cleanup and initrd-parse-etc in kdump
* Wed Jan 3 2024 Tao Liu <ltao@redhat.com> - 2.0.27-7
- Explain the auto_reset_crashkernel option in more details
- Use the same /etc/resolve.conf in kdump initrd if it's managed manually