From e35838d698594580d376d75591c11775c7003d24 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:12:11 +0000 Subject: import kexec-tools-2.0.7-50.el7 --- diff --git a/.gitignore b/.gitignore index 4114f43..67ccd94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ SOURCES/eppic_050615.tar.gz -SOURCES/kdump-anaconda-addon-003-19-gda64a86.tar.gz +SOURCES/kdump-anaconda-addon-003-21-g69da0f8.tar.gz SOURCES/kexec-tools-2.0.7.tar.xz -SOURCES/makedumpfile-1.5.7.tar.gz +SOURCES/makedumpfile-1.6.0.tar.gz diff --git a/.kexec-tools.metadata b/.kexec-tools.metadata index 9edc81a..348dc3e 100644 --- a/.kexec-tools.metadata +++ b/.kexec-tools.metadata @@ -1,4 +1,4 @@ a096c8e0892b559f40b01916aae240652f75b68a SOURCES/eppic_050615.tar.gz -35161100add54ace94d0966fe45a9e3d5755114c SOURCES/kdump-anaconda-addon-003-19-gda64a86.tar.gz +303af76846ca0768503258738a43c8adf80e05ce SOURCES/kdump-anaconda-addon-003-21-g69da0f8.tar.gz 56f3c4c829d0078bb705f980e1d9ba22eb9a6246 SOURCES/kexec-tools-2.0.7.tar.xz -16427d952ce7d0426c8b4aecc92f2960cf7926d3 SOURCES/makedumpfile-1.5.7.tar.gz +c856adc0900638310b0d7d3883b5ee7489395595 SOURCES/makedumpfile-1.6.0.tar.gz diff --git a/SOURCES/dracut-kdump.sh b/SOURCES/dracut-kdump.sh index 4aab205..42ba37f 100755 --- a/SOURCES/dracut-kdump.sh +++ b/SOURCES/dracut-kdump.sh @@ -146,6 +146,10 @@ read_kdump_conf() # remove inline comments after the end of a directive. config_val=$(strip_comments $config_val) case "$config_opt" in + dracut_args) + config_val=$(get_dracut_args_target "$config_val") + [[ -n "$config_val" ]] && add_dump_code "dump_fs $config_val" + ;; ext[234]|xfs|btrfs|minix|nfs) add_dump_code "dump_fs $config_val" ;; diff --git a/SOURCES/dracut-module-setup.sh b/SOURCES/dracut-module-setup.sh index 5a11a42..fb93981 100755 --- a/SOURCES/dracut-module-setup.sh +++ b/SOURCES/dracut-module-setup.sh @@ -63,10 +63,23 @@ kdump_is_vlan() { } # $1: netdev name +source_ifcfg_file() { + local ifcfg_file + + ifcfg_file=$(get_ifcfg_filename $1) + if [ -f "${ifcfg_file}" ]; then + . ${ifcfg_file} + else + dwarning "The ifcfg file of $1 is not found!" + fi +} + +# $1: netdev name kdump_setup_dns() { local _nameserver _dns local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf - . /etc/sysconfig/network-scripts/ifcfg-$1 + + source_ifcfg_file $1 [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile" [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile" @@ -189,7 +202,9 @@ kdump_setup_bond() { done echo -n " bond=$_netdev:$(echo $_slaves | sed 's/,$//')" >> ${initdir}/etc/cmdline.d/42bond.conf # Get bond options specified in ifcfg - . /etc/sysconfig/network-scripts/ifcfg-$_netdev + + source_ifcfg_file $_netdev + bondoptions="$(echo :$BONDING_OPTS | sed 's/\s\+/,/')" echo "$bondoptions" >> ${initdir}/etc/cmdline.d/42bond.conf } @@ -244,7 +259,9 @@ kdump_setup_vlan() { # $1: netdev name kdump_setup_znet() { local _options="" - . /etc/sysconfig/network-scripts/ifcfg-$1 + + source_ifcfg_file $1 + for i in $OPTIONS; do _options=${_options},$i done @@ -336,7 +353,7 @@ kdump_install_net() { # the default gate way for network dump, eth1 in the fence kdump path will # call kdump_install_net again and we don't want eth1 to be the default # gateway. - if [ ! -f ${initdir}${initdir}/etc/cmdline.d/60kdumpnic.conf ] && + if [ ! -f ${initdir}/etc/cmdline.d/60kdumpnic.conf ] && [ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]; then echo "kdumpnic=$(kdump_setup_ifname $_netdev)" > ${initdir}/etc/cmdline.d/60kdumpnic.conf echo "bootdev=$(kdump_setup_ifname $_netdev)" > ${initdir}/etc/cmdline.d/70bootdev.conf @@ -433,6 +450,11 @@ kdump_install_conf() { ssh|nfs) kdump_install_net "$config_val" ;; + dracut_args) + if [[ $(get_dracut_args_fstype "$config_val") = nfs* ]] ; then + kdump_install_net "$(get_dracut_args_target "$config_val")" + fi + ;; kdump_pre|kdump_post|extra_bins) dracut_install $config_val ;; @@ -494,7 +516,11 @@ kdump_get_iscsi_initiator() { return 1 } -# No ibft handling yet. +# Figure out iBFT session according to session type +is_ibft() { + [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ] +} + kdump_setup_iscsi_device() { local path=$1 local tgt_name; local tgt_ipaddr; @@ -517,6 +543,10 @@ kdump_setup_iscsi_device() { return 1 fi + if is_ibft ${path}; then + return + fi + tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name") tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address") @@ -722,12 +752,3 @@ install() { # at some point of time. kdump_check_iscsi_targets } - -installkernel() { - wdt=$(lsmod|cut -f1 -d' '|grep "wdt$") - if [ -n "$wdt" ]; then - [ "$wdt" = "iTCO_wdt" ] && instmods lpc_ich && - echo "rd.driver.pre=lpc_ich,iTCO_wdt " >> ${initdir}/etc/cmdline.d/00-wdt.conf - instmods $wdt - fi -} diff --git a/SOURCES/kdump-lib.sh b/SOURCES/kdump-lib.sh index 89dce8d..7012dcf 100755 --- a/SOURCES/kdump-lib.sh +++ b/SOURCES/kdump-lib.sh @@ -7,6 +7,15 @@ DEFAULT_PATH="/var/crash/" FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump" FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send" +perror_exit() { + echo $@ >&2 + exit 1 +} + +perror() { + echo $@ >&2 +} + is_ssh_dump_target() { grep -q "^ssh[[:blank:]].*@" /etc/kdump.conf @@ -14,7 +23,8 @@ is_ssh_dump_target() is_nfs_dump_target() { - grep -q "^nfs" /etc/kdump.conf + grep -q "^nfs" /etc/kdump.conf || \ + [[ $(get_dracut_args_fstype "$(grep "^dracut_args .*\-\-mount" /etc/kdump.conf)") = nfs* ]] } is_raw_dump_target() @@ -36,7 +46,8 @@ is_fs_dump_target() is_user_configured_dump_target() { - return $(is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target || is_fs_dump_target) + return $(is_mount_in_dracut_args || is_ssh_dump_target || is_nfs_dump_target || \ + is_raw_dump_target || is_fs_dump_target) } strip_comments() @@ -63,6 +74,46 @@ is_generic_fence_kdump() grep -q "^fence_kdump_nodes" /etc/kdump.conf } +to_dev_name() { + local dev="${1//\"/}" + + case "$dev" in + UUID=*) + dev=`blkid -U "${dev#UUID=}"` + ;; + LABEL=*) + dev=`blkid -L "${dev#LABEL=}"` + ;; + esac + echo $dev +} + +kdump_get_persistent_dev() { + local i _tmp _dev _lookup_dirs + + _dev=$(udevadm info --query=name --name="$1" 2>/dev/null) + [ -z "$_dev" ] && { + perror_exit "Kernel dev name of $1 is not found." + } + + if [[ $2 = "raw" ]];then + _lookup_dirs="/dev/mapper/* /dev/disk/by-id/*" + else + _lookup_dirs="/dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*" + fi + + for i in $_lookup_dirs; do + _tmp=$(udevadm info --query=name --name="$i" 2>/dev/null) + if [ "$_tmp" = "$_dev" ]; then + echo $i + return + fi + done + + perror "WARNING: Persistent device name of $1 not found. Using $1 as dump target name" + echo $1 +} + get_user_configured_dump_disk() { local _target @@ -230,3 +281,150 @@ is_hostname() fi echo $1 | grep -q "[a-zA-Z]" } + +# Copied from "/etc/sysconfig/network-scripts/network-functions" +get_hwaddr() +{ + if [ -f "/sys/class/net/${1}/address" ]; then + awk '{ print toupper($0) }' < /sys/class/net/${1}/address + elif [ -d "/sys/class/net/${1}" ]; then + LC_ALL= LANG= ip -o link show ${1} 2>/dev/null | \ + awk '{ print toupper(gensub(/.*link\/[^ ]* ([[:alnum:]:]*).*/, + "\\1", 1)); }' + fi +} + +get_ifcfg_by_device() +{ + grep -E -i -l "^[[:space:]]*DEVICE=\"*${1}\"*[[:space:]]*$" \ + /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1 +} + +get_ifcfg_by_hwaddr() +{ + grep -E -i -l "^[[:space:]]*HWADDR=\"*${1}\"*[[:space:]]*$" \ + /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1 +} + +get_ifcfg_by_uuid() +{ + grep -E -i -l "^[[:space:]]*UUID=\"*${1}\"*[[:space:]]*$" \ + /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1 +} + +get_ifcfg_by_name() +{ + grep -E -i -l "^[[:space:]]*NAME=\"*${1}\"*[[:space:]]*$" \ + /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1 +} + +is_nm_running() +{ + [ "$(LANG=C nmcli -t --fields running general status 2>/dev/null)" = "running" ] +} + +is_nm_handling() +{ + LANG=C nmcli -t --fields device,state dev status 2>/dev/null \ + | grep -q "^\(${1}:connected\)\|\(${1}:connecting.*\)$" +} + +# $1: netdev name +get_ifcfg_nmcli() +{ + local nm_uuid nm_name + local ifcfg_file + + # Get the active nmcli config name of $1 + if is_nm_running && is_nm_handling "${1}" ; then + # The configuration "uuid" and "name" generated by nm is wrote to + # the ifcfg file as "UUID=" and "NAME=". + nm_uuid=$(LANG=C nmcli -t --fields uuid,device c show --active 2>/dev/null \ + | grep "${1}" | head -1 | cut -d':' -f1) + nm_name=$(LANG=C nmcli -t --fields name,device c show --active 2>/dev/null \ + | grep "${1}" | head -1 | cut -d':' -f1) + ifcfg_file=$(get_ifcfg_by_uuid "${nm_uuid}") + [ -z "${ifcfg_file}" ] && ifcfg_file=$(get_ifcfg_by_name "${nm_name}") + fi + + echo -n "${ifcfg_file}" +} + +# $1: netdev name +get_ifcfg_legacy() +{ + local ifcfg_file + + ifcfg_file="/etc/sysconfig/network-scripts/ifcfg-${1}" + [ -f "${ifcfg_file}" ] && echo -n "${ifcfg_file}" && return + + ifcfg_file=$(get_ifcfg_by_name "${1}") + [ -f "${ifcfg_file}" ] && echo -n "${ifcfg_file}" && return + + local hwaddr=$(get_hwaddr "${1}") + if [ -n "$hwaddr" ]; then + ifcfg_file=$(get_ifcfg_by_hwaddr "${hwaddr}") + [ -f "${ifcfg_file}" ] && echo -n "${ifcfg_file}" && return + fi + + ifcfg_file=$(get_ifcfg_by_device "${1}") + + echo -n "${ifcfg_file}" +} + +# $1: netdev name +# Return the ifcfg file whole name(including the path) of $1 if any. +get_ifcfg_filename() { + local ifcfg_file + + ifcfg_file=$(get_ifcfg_nmcli "${1}") + if [ -z "${ifcfg_file}" ]; then + ifcfg_file=$(get_ifcfg_legacy "${1}") + fi + + echo -n "${ifcfg_file}" +} + +# returns 0 when omission of watchdog module is desired in dracut_args +# returns 1 otherwise +is_wdt_mod_omitted() { + local dracut_args + local ret=1 + + dracut_args=$(grep "^dracut_args" /etc/kdump.conf) + [[ -z $dracut_args ]] && return $ret + + eval set -- $dracut_args + while :; do + [[ -z $1 ]] && break + case $1 in + -o|--omit) + echo $2 | grep -qw "watchdog" + [[ $? == 0 ]] && ret=0 + break + esac + shift + done + + return $ret +} + +# If "dracut_args" contains "--mount" information, use it +# directly without any check(users are expected to ensure +# its correctness). +is_mount_in_dracut_args() +{ + grep -q "^dracut_args .*\-\-mount" /etc/kdump.conf +} + +# If $1 contains dracut_args "--mount", return +get_dracut_args_fstype() +{ + echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f3 +} + +# If $1 contains dracut_args "--mount", return +get_dracut_args_target() +{ + echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f1 +} diff --git a/SOURCES/kdump.conf b/SOURCES/kdump.conf index 54b581d..2865414 100644 --- a/SOURCES/kdump.conf +++ b/SOURCES/kdump.conf @@ -1,145 +1,137 @@ -# Configures where to put the kdump /proc/vmcore files -# -# This file contains a series of commands to perform (in order) when a -# kernel crash has happened and the kdump kernel has been loaded. Directives in -# this file are only applicable to the kdump initramfs, and have no effect if -# the root filesystem is mounted and the normal init scripts are processed -# -# Currently only one dump target and path may be configured at once -# if the configured dump target fails, the default action will be preformed -# the default action may be configured with the default directive below. If the -# configured dump target succedes -# -# Basics commands supported are: -# raw - Will dd /proc/vmcore into . -# Use persistent device names for partition devices, -# such as /dev/vg/. -# -# nfs - Will mount fs and copy /proc/vmcore to -# /var/crash/%HOST-%DATE/, supports DNS. -# -# ssh - Will scp /proc/vmcore to -# :/var/crash/%HOST-%DATE/, supports DNS -# NOTE: make sure user has necessary write -# permissions on server -# -# sshkey - Will use the sshkey to do ssh dump -# Specifies the path of the ssh key you want to use -# when do ssh dump, the default value is -# /root/.ssh/kdump_id_rsa. -# -# - Will mount -t /mnt and copy -# /proc/vmcore to /mnt/var/crash/%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 user has not specified a dump -# target explicitly in kdump.conf. In this case, -# "path" represents the absolute path from root. -# And 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 -# default to /var/crash. +# 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 default action which can be configured via +# the "default" 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 scp /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. You could use the dump filtering -# program makedumpfile, the default one, to retrieve -# your core, which on some arches can drastically -# reduce core file 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. -# Default core_collector for raw/ssh dump is: -# "makedumpfile -F -l --message-level 1 -d 31". -# Default core_collector for other targets is: -# "makedumpfile -l --message-level 1 -d 31". -# For core_collector format details please refer to -# kexec-kdump-howto.txt or kdump.conf manpage. +# - 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 1 -d 31". +# The default core_collector for other targets is: +# "makedumpfile -l --message-level 1 -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 specified -# executable just after the memory dump process -# terminates. The exit status from the dump process -# is fed to the kdump_post executable, which can be -# used to trigger different actions for success or -# failure. +# - 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. # # kdump_pre -# - works just like the kdump_post directive, but instead -# of running after the dump process, runs immediately -# before. Exit status of this binary is interpreted -# as follows: -# 0 - continue with dump process as usual -# non 0 - reboot the system +# - 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 - reboot the system # # extra_bins -# - This directive allows you to specify additional -# binaries or shell scripts you'd like to include in -# your kdump initrd. Generally only useful in -# conjunction with a kdump_post binary or script that -# relies on other binaries or scripts. +# - 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, typically used to set up access to -# non-boot-path dump targets that might otherwise -# not be accessible in the kdump environment. Multiple -# modules can be listed, separated by a space, and any -# dependent modules will automatically be included. +# - 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. # # default -# - Action to preform in case dumping to intended target -# fails. If no default action is specified, "reboot" -# is assumed default. -# reboot: If the default action is reboot simply reboot -# the system and loose the core that you are -# trying to retrieve. -# halt: If the default action is halt, then simply -# halt the system after attempting to capture -# a vmcore, regardless of success or failure. -# poweroff: The system will be powered down -# shell: If the default action is shell, then drop to -# an shell session inside the initramfs from -# where you can try to record the core manually. -# Exiting this shell reboots the system. -# Note: kdump uses bash as the default shell. -# dump_to_rootfs: If non-root dump target is specified, -# the default action can be set as dump_to_rootfs. -# That means when dump to target fails, dump vmcore -# to rootfs from initramfs context and reboot. +# - 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. +# dump_to_rootfs: Dump vmcore to rootfs from initramfs context and +# reboot. Useful when non-root dump target is specified. +# The default option is "reboot". # # force_rebuild <0 | 1> -# - By default, kdump initrd only will be rebuilt when -# necessary. Specify 1 to force rebuilding kdump -# initrd every time when kdump service starts. +# - By default, kdump initrd will only be rebuilt whennecessary. +# Specify 1 to force rebuilding kdump initrd every time when kdump +# service starts. # -#override_resettable <0 | 1> -# - Usually a unresettable block device can't be dump target. -# Specifying 1 means though block target is unresettable, user -# understand this situation and want to try dumping. By default, -# it's set to 0, means not to try a destined failure. +# 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. +# - 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). +# - 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) separated by space to send fence_kdump -# notification to (this option is mandatory to enable fence_kdump). +# - List of cluster node(s), separated by spaces, to send +# fence_kdump notifications to (this option is mandatory to +# enable fence_kdump). # #raw /dev/vg/lv_kdump diff --git a/SOURCES/kdump.conf.5 b/SOURCES/kdump.conf.5 index f1c2a2c..ca42769 100644 --- a/SOURCES/kdump.conf.5 +++ b/SOURCES/kdump.conf.5 @@ -10,14 +10,14 @@ collection service. kdump.conf provides post-kexec instructions to the kdump kernel. It is stored in the initrd file managed by the kdump service. If you change -this file and do not want to restart before it takes effect, restart -the kdump service to rebuild to initrd. +this file and do not want to reboot in order for the changes to take +effect, restart the kdump service to rebuild the initrd. For most configurations, you can simply review the examples provided in the stock /etc/kdump.conf. .B NOTE: -For filesystem dump the dump target must be mounted before building +For filesystem dumps the dump target must be mounted before building kdump initramfs. kdump.conf only affects the behavior of the initramfs. Please read the @@ -34,30 +34,30 @@ partition devices, such as /dev/vg/. .B nfs .RS -Will mount fs and copy /proc/vmcore to /var/crash/%HOST-%DATE/, +Will mount nfs to , and copy /proc/vmcore to //%HOST-%DATE/, supports DNS. Note that a fqdn should be used as the server name in the -mount point +mount point. .RE .B ssh .RS -Will scp /proc/vmcore to :/var/crash/%HOST-%DATE/, +Will scp /proc/vmcore to :/%HOST-%DATE/, supports DNS. NOTE: make sure user has necessary write permissions on -server and that a fqdn is used as the server name +server and that a fqdn is used as the server name. .RE .B sshkey .RS -Specifies the path of the ssh key you want to use when do ssh dump, -the default value is /root/.ssh/kdump_id_rsa. +Specify the path of the ssh key to use when dumping via ssh. +The default value is /root/.ssh/kdump_id_rsa. .RE .B .RS -Will mount -t /mnt and copy /proc/vmcore to -/mnt/var/crash/%DATE/. NOTE: can be a device node, label +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. +/dev/vg/. Otherwise it's suggested to use label or uuid. .RE .B path @@ -66,37 +66,36 @@ or uuid. It's recommended to use persistent device names such as If a dump target is specified in kdump.conf, then "path" is relative to the specified dump target. .PP -Interpretation of path changes a bit if user has not specified a dump +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. And dump target and adjusted path are arrived +absolute path from root. The dump target and adjusted path are arrived at automatically depending on what's mounted in the current system. .PP -Ignored for raw device dumps. If unset, will default to /var/crash. +Ignored for raw device dumps. If unset, will use the default "/var/crash". .RE .B core_collector .RS This allows you to specify the command to copy the vmcore. -You could use the dump filtering program makedumpfile, the default one, -to retrieve your core, which on some arches can drastically reduce -core file size. See /sbin/makedumpfile --help for a list of options. +The default is makedumpfile, which on some architectures can drastically reduce +core file 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. .PP Note 1: About default core collector: -Default core_collector for raw/ssh dump is: +The default core_collector for raw/ssh dump is: "makedumpfile -F -l --message-level 1 -d 31". -Default core_collector for other targets is: +The default core_collector for other targets is: "makedumpfile -l --message-level 1 -d 31". Even if core_collector option is commented out in kdump.conf, makedumpfile -is default core collector and kdump uses it internally. +is the default core collector and kdump uses it internally. If one does not want makedumpfile as default core_collector, then they need to specify one using core_collector option to change the behavior. .PP Note 2: If "makedumpfile -F" is used then you will get a flattened format vmcore.flat, you will need to use "makedumpfile -R" to rearrange the -dump data from stdard input to a normal dumpfile (readable with analysis +dump data from standard input to a normal dumpfile (readable with analysis tools). ie. "makedumpfile -R vmcore < vmcore.flat" @@ -104,20 +103,19 @@ ie. "makedumpfile -R vmcore < vmcore.flat" .B kdump_post .RS -This directive allows you to run a specified -executable just after the memory dump process -terminates. The exit status from the dump process -is fed to the kdump_post executable, which can be -used to trigger different actions for success or -failure. +This directive allows you to run a specified executable +just after the vmcore dump process terminates. The exit +status of the current dump process is fed to the kdump_post +executable as its first argument($1). Executable can modify +it to indicate the new exit status of succeeding dump process, .PP -Note that scripts written for use with this -directive must use the /bin/bash interpreter +Note that scripts written for use with this directive must use +the /bin/bash interpreter. .RE .B kdump_pre .RS -Works just like the kdump_post directive, but instead +Works just like the "kdump_post" directive, but instead of running after the dump process, runs immediately before. Exit status of this binary is interpreted as follows: @@ -127,7 +125,7 @@ as follows: non 0 - reboot the system .PP Note that scripts written for this directive must use -the /bin/bash interpreter +the /bin/bash interpreter. .RE .B extra_bins @@ -146,36 +144,33 @@ modules that you want to be loaded in the kdump initrd, typically used to set up access to non-boot-path dump targets that might otherwise not be accessible in the kdump environment. Multiple -modules can be listed, separated by a space, and any +modules can be listed, separated by spaces, and any dependent modules will automatically be included. .RE .B default .RS -Action to preform in case dumping to intended target fails. If no default -action is specified, "reboot" is assumed default. -reboot: If the default action is reboot simply reboot the system (this is what -most people will want, as it returns the system to a nominal state). shell: If the default -action is shell, then drop to an shell session inside the initramfs from -where you can manually preform additional recovery actions. Exiting this shell -reboots the system. halt: bring the system to a halt, requiring manual reset -poweroff: The system will be powered down. dump_to_rootfs:If the default action -is dump_to_rootfs, specified root will be mounted and dump will be saved in "path" -directory. -Note: kdump uses bash as the default shell. +Action to perform in case dumping to the intended target fails. The default is "reboot". +reboot: Reboot the system (this is what most people will want, as it returns the system +to a normal state). halt: Halt the system and lose the vmcore. poweroff: The system +will be powered down. shell: Drop to a shell session inside the initramfs, from which +you can manually perform additional recovery actions. Exiting this shell reboots the +system. Note: kdump uses bash as the default shell. dump_to_rootfs: If non-root dump +target is specified, the default action can be set as dump_to_rootfs. That means when +dumping to target fails, dump vmcore to rootfs from initramfs context and reboot. .RE .B force_rebuild <0 | 1> .RS -By default, kdump initrd only will be rebuilt when necessary. +By default, kdump initrd will only be rebuilt when necessary. Specify 1 to force rebuilding kdump initrd every time when kdump service starts. .RE .B override_resettable <0 | 1> .RS -Usually a unresettable block device can't be dump target. Specifying 1 means -though block target is unresettable, user understand this situation and want -to try dumping. By default, it's set to 0, means not to try a destined failure. +Usually an unresettable block device can't be a dump target. Specifying 1 means +that even though the block target is unresettable, the user wants to try dumping anyway. +By default, it's set to 0, which will not try something destined to fail. .RE @@ -195,7 +190,7 @@ arguments except hosts to send notification to). .B fence_kdump_nodes .RS -List of cluster node(s) separated by space to send fence_kdump notification +List of cluster node(s), separated by spaces, to send fence_kdump notification to (this option is mandatory to enable fence_kdump). .RE @@ -210,26 +205,26 @@ directly. .B options