diff --git a/.gitignore b/.gitignore index 9b2024c..d6b0ce0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ SOURCES/1.7.1.tar.gz SOURCES/eppic_050615.tar.gz -SOURCES/kexec-tools-2.0.24.tar.xz +SOURCES/kexec-tools-2.0.25.tar.xz diff --git a/.kexec-tools.metadata b/.kexec-tools.metadata index 34c9eeb..321a87f 100644 --- a/.kexec-tools.metadata +++ b/.kexec-tools.metadata @@ -1,3 +1,3 @@ 8f8485c2a1edbc730f4fa1b96ae3ec8d8f1f9761 SOURCES/1.7.1.tar.gz a096c8e0892b559f40b01916aae240652f75b68a SOURCES/eppic_050615.tar.gz -62b7a99779d66ffd07a1684f7b640d32c9697f0c SOURCES/kexec-tools-2.0.24.tar.xz +78d5d4f7e9d358ca234db9c84a551d9d411eb0b5 SOURCES/kexec-tools-2.0.25.tar.xz diff --git a/SOURCES/dracut-module-setup.sh b/SOURCES/dracut-module-setup.sh index 7ad8507..9cbb5d6 100755 --- a/SOURCES/dracut-module-setup.sh +++ b/SOURCES/dracut-module-setup.sh @@ -1,5 +1,20 @@ #!/bin/bash +_save_kdump_netifs() { + local _name + + if [[ -n $2 ]]; then + _name=$2 + else + _name=$1 + fi + unique_netifs[$1]=$_name +} + +_get_kdump_netifs() { + echo -n "${!unique_netifs[@]}" +} + kdump_module_init() { if ! [[ -d "${initdir}/tmp" ]]; then mkdir -p "${initdir}/tmp" @@ -42,6 +57,14 @@ depends() { _dep="$_dep ssh-client" fi + if is_lvm2_thinp_dump_target; then + if grep -q lvmthinpool-monitor <<< $(dracut --list-modules); then + add_opt_module lvmthinpool-monitor + else + dwarning "Required lvmthinpool-monitor modules is missing! Please upgrade dracut >= 057." + fi + fi + if [ "$(uname -m)" = "s390x" ]; then _dep="$_dep znet" fi @@ -300,11 +323,35 @@ kdump_setup_ifname() { echo "$_ifname" } +kdump_install_nm_netif_allowlist() { + local _netif _except_netif _netif_allowlist _netif_allowlist_nm_conf + + for _netif in $1; do + _per_mac=$(kdump_get_perm_addr "$_netif") + if [[ "$_per_mac" != 'not set' ]]; then + _except_netif="mac:$_per_mac" + else + _except_netif="interface-name:${unique_netifs[${_netif}]}" + fi + _netif_allowlist="${_netif_allowlist}except:${_except_netif};" + done + + _netif_allowlist_nm_conf=${initdir}/tmp/netif_allowlist_nm_conf + cat << EOF > "$_netif_allowlist_nm_conf" +[device-others] +match-device=${_netif_allowlist} +managed=false +EOF + + inst "$_netif_allowlist_nm_conf" "/etc/NetworkManager/conf.d/10-kdump-netif_allowlist.conf" + rm -f "$_netif_allowlist_nm_conf" +} + kdump_setup_bridge() { local _netdev=$1 local _brif _dev _mac _kdumpdev for _dev in `ls /sys/class/net/$_netdev/brif/`; do - _kdumpdev=$_dev + _kdumpdev="" if kdump_is_bond "$_dev"; then kdump_setup_bond "$_dev" elif kdump_is_team "$_dev"; then @@ -316,6 +363,8 @@ kdump_setup_bridge() { _kdumpdev=$(kdump_setup_ifname $_dev) echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/41bridge.conf fi + _save_kdump_netifs "$_dev" "$_kdumpdev" + [[ -z $_kdumpdev ]] && _kdumpdev=$_dev _brif+="$_kdumpdev," done echo " bridge=$_netdev:$(echo $_brif | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/41bridge.conf @@ -327,6 +376,7 @@ kdump_setup_bond() { for _dev in `cat /sys/class/net/$_netdev/bonding/slaves`; do _mac=$(kdump_get_perm_addr $_dev) _kdumpdev=$(kdump_setup_ifname $_dev) + _save_kdump_netifs "$_dev" "$_kdumpdev" echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/42bond.conf _slaves+="$_kdumpdev," done @@ -345,6 +395,7 @@ kdump_setup_team() { for _dev in `teamnl $_netdev ports | awk -F':' '{print $2}'`; do _mac=$(kdump_get_perm_addr $_dev) _kdumpdev=$(kdump_setup_ifname $_dev) + _save_kdump_netifs "$_dev" "$_kdumpdev" echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/44team.conf _slaves+="$_kdumpdev," done @@ -379,6 +430,7 @@ kdump_setup_vlan() { _kdumpdev="$(kdump_setup_ifname $_phydev)" echo " vlan=$(kdump_setup_ifname $_netdev):$_kdumpdev ifname=$_kdumpdev:$_netmac" > ${initdir}/etc/cmdline.d/43vlan.conf fi + _save_kdump_netifs "$_phydev" "$_kdumpdev" } # find online znet device @@ -420,10 +472,13 @@ kdump_setup_znet() { source_ifcfg_file $_netdev + [[ -z "$NETTYPE" ]] && return + [[ -z "$SUBCHANNELS" ]] && return + for i in $OPTIONS; do _options=${_options},$i done - echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} rd.znet_ifname=$_netdev:${SUBCHANNELS} > ${initdir}/etc/cmdline.d/30znet.conf + echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} rd.znet_ifname=$(kdump_setup_ifname $_netdev):${SUBCHANNELS} > ${initdir}/etc/cmdline.d/30znet.conf } # Setup dracut to bringup a given network interface @@ -477,6 +532,7 @@ kdump_setup_netdev() { _ifname_opts=" ifname=$kdumpnic:$_netmac" echo "$_ifname_opts" >> $_ip_conf fi + _save_kdump_netifs "$_netdev" "$_kdumpdev" kdump_setup_dns "$_netdev" @@ -765,7 +821,7 @@ kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1 - kdump_check_setup_iscsi() ( + kdump_check_setup_iscsi() { local _dev _dev=$1 @@ -775,7 +831,7 @@ kdump_check_iscsi_targets () { cd .. done [[ -d iscsi_session ]] && kdump_setup_iscsi_device "$PWD" - ) + } [[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves_all kdump_check_setup_iscsi @@ -941,7 +997,8 @@ kdump_install_systemd_conf() { } install() { - local arch + declare -A unique_netifs + local arch _netifs kdump_module_init kdump_install_conf @@ -993,6 +1050,11 @@ install() { # at some point of time. kdump_check_iscsi_targets + _netifs=$(_get_kdump_netifs) + if [[ -n "$_netifs" ]]; then + kdump_install_nm_netif_allowlist "$_netifs" + fi + kdump_install_systemd_conf # For the lvm type target under kdump, in /etc/lvm/lvm.conf we can diff --git a/SOURCES/gen-kdump-conf.sh b/SOURCES/gen-kdump-conf.sh new file mode 100755 index 0000000..4bda9e8 --- /dev/null +++ b/SOURCES/gen-kdump-conf.sh @@ -0,0 +1,223 @@ +#!/bin/bash +# $1: target arch + + +SED_EXP="" + +generate() +{ + sed "$SED_EXP" << EOF +# This file contains a series of commands to perform (in order) in the kdump +# kernel after a kernel crash in the crash kernel(1st kernel) has happened. +# +# Directives in this file are only applicable to the kdump initramfs, and have +# no effect once the root filesystem is mounted and the normal init scripts are +# processed. +# +# Currently, only one dump target and path can be specified. If the dumping to +# the configured target fails, the failure action which can be configured via +# the "failure_action" directive will be performed. +# +# Supported options: +# +# raw +# - Will dd /proc/vmcore into . +# Use persistent device names for partition devices, +# such as /dev/vg/. +# +# nfs +# - Will mount nfs to , and copy /proc/vmcore to +# //%HOST-%DATE/, supports DNS. +# +# ssh +# - Will save /proc/vmcore to :/%HOST-%DATE/, +# supports DNS. +# NOTE: make sure the user has write permissions on the server. +# +# sshkey +# - Will use the sshkey to do ssh dump. +# Specify the path of the ssh key to use when dumping +# via ssh. The default value is /root/.ssh/kdump_id_rsa. +# +# +# - Will mount -t , and copy +# /proc/vmcore to //%DATE/. +# NOTE: can be a device node, label or uuid. +# It's recommended to use persistent device names +# such as /dev/vg/. +# Otherwise it's suggested to use label or uuid. +# +# path +# - "path" represents the file system path in which vmcore +# will be saved. If a dump target is specified in +# kdump.conf, then "path" is relative to the specified +# dump target. +# +# Interpretation of "path" changes a bit if the user didn't +# specify any dump target explicitly in kdump.conf. In this +# case, "path" represents the absolute path from root. The +# dump target and adjusted path are arrived at automatically +# depending on what's mounted in the current system. +# +# Ignored for raw device dumps. If unset, will use the default +# "/var/crash". +# +# core_collector +# - This allows you to specify the command to copy +# the vmcore. The default is makedumpfile, which on +# some architectures can drastically reduce vmcore size. +# See /sbin/makedumpfile --help for a list of options. +# Note that the -i and -g options are not needed here, +# as the initrd will automatically be populated with a +# config file appropriate for the running kernel. +# The default core_collector for raw/ssh dump is: +# "makedumpfile -F -l --message-level 7 -d 31". +# The default core_collector for other targets is: +# "makedumpfile -l --message-level 7 -d 31". +# +# "makedumpfile -F" will create a flattened vmcore. +# You need to use "makedumpfile -R" to rearrange the dump data to +# a normal dumpfile readable with analysis tools. For example: +# "makedumpfile -R vmcore < vmcore.flat". +# +# For core_collector format details, you can refer to +# kexec-kdump-howto.txt or kdump.conf manpage. +# +# kdump_post +# - This directive allows you to run a executable binary +# or script after the vmcore dump process terminates. +# The exit status of the current dump process is fed to +# the executable binary or script as its first argument. +# All files under /etc/kdump/post.d are collectively sorted +# and executed in lexical order, before binary or script +# specified kdump_post parameter is executed. +# +# kdump_pre +# - Works like the "kdump_post" directive, but instead of running +# after the dump process, runs immediately before it. +# Exit status of this binary is interpreted as follows: +# 0 - continue with dump process as usual +# non 0 - run the final action (reboot/poweroff/halt) +# All files under /etc/kdump/pre.d are collectively sorted and +# executed in lexical order, after binary or script specified +# kdump_pre parameter is executed. +# Even if the binary or script in /etc/kdump/pre.d directory +# returns non 0 exit status, the processing is continued. +# +# extra_bins +# - This directive allows you to specify additional binaries or +# shell scripts to be included in the kdump initrd. +# Generally they are useful in conjunction with a kdump_post +# or kdump_pre binary or script which depends on these extra_bins. +# +# extra_modules +# - This directive allows you to specify extra kernel modules +# that you want to be loaded in the kdump initrd. +# Multiple modules can be listed, separated by spaces, and any +# dependent modules will automatically be included. +# +# failure_action +# - Action to perform in case dumping fails. +# reboot: Reboot the system. +# halt: Halt the system. +# poweroff: Power down the system. +# shell: Drop to a bash shell. +# Exiting the shell reboots the system by default, +# or perform "final_action". +# dump_to_rootfs: Dump vmcore to rootfs from initramfs context and +# reboot by default or perform "final_action". +# Useful when non-root dump target is specified. +# The default option is "reboot". +# +# default +# - Same as the "failure_action" directive above, but this directive +# is obsolete and will be removed in the future. +# +# final_action +# - Action to perform in case dumping succeeds. Also performed +# when "shell" or "dump_to_rootfs" failure action finishes. +# Each action is same as the "failure_action" directive above. +# The default is "reboot". +# +# force_rebuild <0 | 1> +# - By default, kdump initrd will only be rebuilt when necessary. +# Specify 1 to force rebuilding kdump initrd every time when kdump +# service starts. +# +# force_no_rebuild <0 | 1> +# - By default, kdump initrd will be rebuilt when necessary. +# Specify 1 to bypass rebuilding of kdump initrd. +# +# force_no_rebuild and force_rebuild options are mutually +# exclusive and they should not be set to 1 simultaneously. +# +# override_resettable <0 | 1> +# - Usually an unresettable block device can't be a dump target. +# Specifying 1 when you want to dump even though the block +# target is unresettable +# By default, it is 0, which will not try dumping destined to fail. +# +# dracut_args +# - Pass extra dracut options when rebuilding kdump initrd. +# +# fence_kdump_args +# - Command line arguments for fence_kdump_send (it can contain +# all valid arguments except hosts to send notification to). +# +# fence_kdump_nodes +# - List of cluster node(s) except localhost, separated by spaces, +# to send fence_kdump notifications to. +# (this option is mandatory to enable fence_kdump). +# + +#raw /dev/vg/lv_kdump +#ext4 /dev/vg/lv_kdump +#ext4 LABEL=/boot +#ext4 UUID=03138356-5e61-4ab3-b58e-27507ac41937 +#nfs my.server.com:/export/tmp +#nfs [2001:db8::1:2:3:4]:/export/tmp +#ssh user@my.server.com +#ssh user@2001:db8::1:2:3:4 +#sshkey /root/.ssh/kdump_id_rsa +path /var/crash +core_collector makedumpfile -l --message-level 7 -d 31 +#core_collector scp +#kdump_post /var/crash/scripts/kdump-post.sh +#kdump_pre /var/crash/scripts/kdump-pre.sh +#extra_bins /usr/bin/lftp +#extra_modules gfs2 +#failure_action shell +#force_rebuild 1 +#force_no_rebuild 1 +#dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3" +#fence_kdump_args -p 7410 -f auto -c 0 -i 10 +#fence_kdump_nodes node1 node2 +EOF +} + +update_param() +{ + SED_EXP="${SED_EXP}s/^$1.*$/$1 $2/;" +} + +case "$1" in +aarch64) + ;; +i386) + ;; +ppc64) + ;; +ppc64le) + ;; +s390x) + update_param core_collector \ + "makedumpfile -c --message-level 7 -d 31" + ;; +x86_64) + ;; +*) + echo "Warning: Unknown architecture '$1', using default kdump.conf template." + ;; +esac + +generate diff --git a/SOURCES/kdump-lib-initramfs.sh b/SOURCES/kdump-lib-initramfs.sh index e030fe6..6c707f4 100755 --- a/SOURCES/kdump-lib-initramfs.sh +++ b/SOURCES/kdump-lib-initramfs.sh @@ -145,9 +145,15 @@ dump_fs() $CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete _exitcode=$? if [ $_exitcode -eq 0 ]; then - mv $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore - sync - dinfo "saving vmcore complete" + sync -f "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete" + _sync_exitcode=$? + if [ $_sync_exitcode -eq 0 ]; then + mv "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete" "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore" + dinfo "saving vmcore complete" + else + derror "sync vmcore failed, _exitcode:$_sync_exitcode" + return 1 + fi else derror "saving vmcore failed, _exitcode:$_exitcode" fi diff --git a/SOURCES/kdump-lib.sh b/SOURCES/kdump-lib.sh index 3439e7e..4abef85 100755 --- a/SOURCES/kdump-lib.sh +++ b/SOURCES/kdump-lib.sh @@ -7,6 +7,7 @@ DEFAULT_PATH="/var/crash/" FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump" FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send" FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled" +LVM_CONF="/etc/lvm/lvm.conf" is_fadump_capable() { @@ -62,6 +63,15 @@ is_fs_dump_target() egrep -q "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf } +is_lvm2_thinp_device() +{ + _device_path=$1 + _lvm2_thin_device=$(lvm lvs -S 'lv_layout=sparse && lv_layout=thin' \ + --nosuffix --noheadings -o vg_name,lv_name "$_device_path" 2> /dev/null) + + [ -n "$_lvm2_thin_device" ] +} + strip_comments() { echo $@ | sed -e 's/\(.*\)#.*/\1/' @@ -161,6 +171,12 @@ is_dump_to_rootfs() grep -E "^(failure_action|default)[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null } +is_lvm2_thinp_dump_target() +{ + _target=$(get_block_dump_target) + [ -n "$_target" ] && is_lvm2_thinp_device "$_target" +} + get_failure_action_target() { local _target @@ -734,7 +750,13 @@ prepare_kdump_bootinfo() if [[ -z $KDUMP_KERNELVER ]]; then KDUMP_KERNELVER=$(uname -r) - nondebug_kernelver=$(sed -n -e 's/\(.*\)+debug$/\1/p' <<< "$KDUMP_KERNELVER") + + # Fadump uses the regular bootloader, unlike kdump. So, use the same version + # for default kernel and capture kernel unless specified explicitly with + # KDUMP_KERNELVER option. + if ! is_fadump_capable; then + nondebug_kernelver=$(sed -n -e 's/\(.*\)+debug$/\1/p' <<< "$KDUMP_KERNELVER") + fi fi # Use nondebug kernel if possible, because debug kernel will consume more memory and may oom. diff --git a/SOURCES/kdump.conf b/SOURCES/kdump.conf deleted file mode 100644 index a0af268..0000000 --- a/SOURCES/kdump.conf +++ /dev/null @@ -1,185 +0,0 @@ -# This file contains a series of commands to perform (in order) in the kdump -# kernel after a kernel crash in the crash kernel(1st kernel) has happened. -# -# Directives in this file are only applicable to the kdump initramfs, and have -# no effect once the root filesystem is mounted and the normal init scripts are -# processed. -# -# Currently, only one dump target and path can be specified. If the dumping to -# the configured target fails, the failure action which can be configured via -# the "failure_action" directive will be performed. -# -# Supported options: -# -# raw -# - Will dd /proc/vmcore into . -# Use persistent device names for partition devices, -# such as /dev/vg/. -# -# nfs -# - Will mount nfs to , and copy /proc/vmcore to -# //%HOST-%DATE/, supports DNS. -# -# ssh -# - Will save /proc/vmcore to :/%HOST-%DATE/, -# supports DNS. -# NOTE: make sure the user has write permissions on the server. -# -# sshkey -# - Will use the sshkey to do ssh dump. -# Specify the path of the ssh key to use when dumping -# via ssh. The default value is /root/.ssh/kdump_id_rsa. -# -# -# - Will mount -t , and copy -# /proc/vmcore to //%DATE/. -# NOTE: can be a device node, label or uuid. -# It's recommended to use persistent device names -# such as /dev/vg/. -# Otherwise it's suggested to use label or uuid. -# -# path -# - "path" represents the file system path in which vmcore -# will be saved. If a dump target is specified in -# kdump.conf, then "path" is relative to the specified -# dump target. -# -# Interpretation of "path" changes a bit if the user didn't -# specify any dump target explicitly in kdump.conf. In this -# case, "path" represents the absolute path from root. The -# dump target and adjusted path are arrived at automatically -# depending on what's mounted in the current system. -# -# Ignored for raw device dumps. If unset, will use the default -# "/var/crash". -# -# core_collector -# - This allows you to specify the command to copy -# the vmcore. The default is makedumpfile, which on -# some architectures can drastically reduce vmcore size. -# See /sbin/makedumpfile --help for a list of options. -# Note that the -i and -g options are not needed here, -# as the initrd will automatically be populated with a -# config file appropriate for the running kernel. -# The default core_collector for raw/ssh dump is: -# "makedumpfile -F -l --message-level 7 -d 31". -# The default core_collector for other targets is: -# "makedumpfile -l --message-level 7 -d 31". -# -# "makedumpfile -F" will create a flattened vmcore. -# You need to use "makedumpfile -R" to rearrange the dump data to -# a normal dumpfile readable with analysis tools. For example: -# "makedumpfile -R vmcore < vmcore.flat". -# -# For core_collector format details, you can refer to -# kexec-kdump-howto.txt or kdump.conf manpage. -# -# kdump_post -# - This directive allows you to run a executable binary -# or script after the vmcore dump process terminates. -# The exit status of the current dump process is fed to -# the executable binary or script as its first argument. -# All files under /etc/kdump/post.d are collectively sorted -# and executed in lexical order, before binary or script -# specified kdump_post parameter is executed. -# -# kdump_pre -# - Works like the "kdump_post" directive, but instead of running -# after the dump process, runs immediately before it. -# Exit status of this binary is interpreted as follows: -# 0 - continue with dump process as usual -# non 0 - run the final action (reboot/poweroff/halt) -# All files under /etc/kdump/pre.d are collectively sorted and -# executed in lexical order, after binary or script specified -# kdump_pre parameter is executed. -# Even if the binary or script in /etc/kdump/pre.d directory -# returns non 0 exit status, the processing is continued. -# -# extra_bins -# - This directive allows you to specify additional binaries or -# shell scripts to be included in the kdump initrd. -# Generally they are useful in conjunction with a kdump_post -# or kdump_pre binary or script which depends on these extra_bins. -# -# extra_modules -# - This directive allows you to specify extra kernel modules -# that you want to be loaded in the kdump initrd. -# Multiple modules can be listed, separated by spaces, and any -# dependent modules will automatically be included. -# -# failure_action -# - Action to perform in case dumping fails. -# reboot: Reboot the system. -# halt: Halt the system. -# poweroff: Power down the system. -# shell: Drop to a bash shell. -# Exiting the shell reboots the system by default, -# or perform "final_action". -# dump_to_rootfs: Dump vmcore to rootfs from initramfs context and -# reboot by default or perform "final_action". -# Useful when non-root dump target is specified. -# The default option is "reboot". -# -# default -# - Same as the "failure_action" directive above, but this directive -# is obsolete and will be removed in the future. -# -# final_action -# - Action to perform in case dumping succeeds. Also performed -# when "shell" or "dump_to_rootfs" failure action finishes. -# Each action is same as the "failure_action" directive above. -# The default is "reboot". -# -# force_rebuild <0 | 1> -# - By default, kdump initrd will only be rebuilt when necessary. -# Specify 1 to force rebuilding kdump initrd every time when kdump -# service starts. -# -# force_no_rebuild <0 | 1> -# - By default, kdump initrd will be rebuilt when necessary. -# Specify 1 to bypass rebuilding of kdump initrd. -# -# force_no_rebuild and force_rebuild options are mutually -# exclusive and they should not be set to 1 simultaneously. -# -# override_resettable <0 | 1> -# - Usually an unresettable block device can't be a dump target. -# Specifying 1 when you want to dump even though the block -# target is unresettable -# By default, it is 0, which will not try dumping destined to fail. -# -# dracut_args -# - Pass extra dracut options when rebuilding kdump initrd. -# -# fence_kdump_args -# - Command line arguments for fence_kdump_send (it can contain -# all valid arguments except hosts to send notification to). -# -# fence_kdump_nodes -# - List of cluster node(s) except localhost, separated by spaces, -# to send fence_kdump notifications to. -# (this option is mandatory to enable fence_kdump). -# - -#raw /dev/vg/lv_kdump -#ext4 /dev/vg/lv_kdump -#ext4 LABEL=/boot -#ext4 UUID=03138356-5e61-4ab3-b58e-27507ac41937 -#nfs my.server.com:/export/tmp -#nfs [2001:db8::1:2:3:4]:/export/tmp -#ssh user@my.server.com -#ssh user@2001:db8::1:2:3:4 -#sshkey /root/.ssh/kdump_id_rsa -path /var/crash -core_collector makedumpfile -l --message-level 7 -d 31 -#core_collector scp -#kdump_post /var/crash/scripts/kdump-post.sh -#kdump_pre /var/crash/scripts/kdump-pre.sh -#extra_bins /usr/bin/lftp -#extra_modules gfs2 -#failure_action shell -#force_rebuild 1 -#force_no_rebuild 1 -#dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3" -#fence_kdump_args -p 7410 -f auto -c 0 -i 10 -#fence_kdump_nodes node1 node2 diff --git a/SOURCES/kdumpctl b/SOURCES/kdumpctl index ec21495..ba32806 100755 --- a/SOURCES/kdumpctl +++ b/SOURCES/kdumpctl @@ -398,6 +398,7 @@ check_files_modified() # HOOKS is mandatory and need to check the modification time files="$files $HOOKS" + is_lvm2_thinp_dump_target && files="$files $LVM_CONF" check_exist "$files" && check_executable "$EXTRA_BINS" [ $? -ne 0 ] && return 2 @@ -486,8 +487,9 @@ check_fs_modified() fi # No need to check in case of raw target. - # Currently we do not check also if ssh/nfs target is specified - if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target; then + # Currently we do not check also if ssh/nfs/thinp target is specified + if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target || + is_lvm2_thinp_dump_target; then return 0 fi @@ -694,6 +696,7 @@ load_kdump() # and release it. exec 12>&2 exec 2>> $KDUMP_LOG_PATH/kdump.log + chmod 600 $KDUMP_LOG_PATH/kdump.log PS4='+ $(date "+%Y-%m-%d %H:%M:%S") ${BASH_SOURCE}@${LINENO}: ' set -x diff --git a/SOURCES/mkdumprd b/SOURCES/mkdumprd index 710f4e1..23013d3 100644 --- a/SOURCES/mkdumprd +++ b/SOURCES/mkdumprd @@ -226,7 +226,7 @@ check_user_configured_target() # For user configured target, use $SAVE_PATH as the dump path within the target if [ ! -d "$_mnt/$SAVE_PATH" ]; then - perror_exit "Dump path \"$_mnt/$SAVE_PATH\" does not exist in dump target \"$_target\"" + perror_exit "Dump path \"$SAVE_PATH\" does not exist in dump target \"$_target\"" fi check_size fs "$_target" diff --git a/SPECS/kexec-tools.spec b/SPECS/kexec-tools.spec index 7061908..df0e907 100644 --- a/SPECS/kexec-tools.spec +++ b/SPECS/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools -Version: 2.0.24 -Release: 6%{?dist} +Version: 2.0.25 +Release: 5%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component @@ -12,7 +12,7 @@ Source3: kdump.sysconfig.x86_64 Source4: kdump.sysconfig.i386 Source5: kdump.sysconfig.ppc64 Source7: mkdumprd -Source8: kdump.conf +Source8: gen-kdump-conf.sh Source9: https://github.com/makedumpfile/makedumpfile/archive/1.7.1.tar.gz Source10: kexec-kdump-howto.txt Source12: mkdumprd.8 @@ -158,6 +158,9 @@ cp %{SOURCE27} . cp %{SOURCE28} . cp %{SOURCE31} . +# Generate sysconfig file +%{SOURCE8} %{_target_cpu} > kdump.conf + make %ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64 make -C eppic/libeppic @@ -196,7 +199,7 @@ install -m 644 $SYSCONFIG $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/usr/sbin/mkdumprd install -m 755 %{SOURCE36} $RPM_BUILD_ROOT/usr/sbin/mkfadumprd -install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf +install -m 644 kdump.conf $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf install -m 644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/kexec.8 install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man8/mkdumprd.8 install -m 644 %{SOURCE25} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8 @@ -393,6 +396,28 @@ done %endif %changelog +* Wed Jan 18 2023 Pingfan Liu - 2.0.25-5 + dracut-module-setup: Fix invalid rd.znet command line entry + dracut-module-setup: Fix persistent nic name on s390 + +* Mon Jan 9 2023 Pingfan Liu - 2.0.25-4 +- Don't check fs modified when dump target is lvm2 thinp +- Add dependency of dracut lvmthinpool-monitor module +- lvm.conf should be check modified if lvm2 thinp enabled +- Add lvm2 thin provision dump target checker +- Fix the sync issue for dump_fs + +* Fri Dec 2 2022 Pingfan Liu - 2.0.25-3 +- kdump.conf: use a simple generator script to maintain +- Reduce kdump memory consumption by not letting NetworkManager manage unneeded network interfaces + +* Mon Oct 17 2022 Pingfan Liu - 2.0.25-2 +- mkdumprd: Improve error messages on non-existing NFS target directories +- fadump: avoid non-debug kernel use for fadump case + +* Sun Sep 18 2022 Pingfan Liu - 2.0.24-7 +- kdumpctl: make the kdump.log root-readable-only + * Mon Jul 18 2022 Pingfan Liu - 2.0.24-6 - kdump-lib: Add the CoreOS kernel dir to the boot_dirlist - kdump-lib: attempt to fix BOOT_IMAGE detection