893e0b
# This file contains a series of commands to perform (in order) in the kdump
893e0b
# kernel after a kernel crash in the crash kernel(1st kernel) has happened.
893e0b
#
893e0b
# Directives in this file are only applicable to the kdump initramfs, and have
893e0b
# no effect once the root filesystem is mounted and the normal init scripts are
893e0b
# processed.
893e0b
#
893e0b
# Currently, only one dump target and path can be specified.  If the dumping to
603de6
# the configured target fails, the failure action which can be configured via
603de6
# the "failure_action" directive will be performed.
893e0b
#
893e0b
# Supported options:
893e0b
#
893e0b
# raw <partition>
893e0b
#           - Will dd /proc/vmcore into <partition>.
893e0b
#             Use persistent device names for partition devices,
893e0b
#             such as /dev/vg/<devname>.
893e0b
#
893e0b
# nfs <nfs mount>
893e0b
#           - Will mount nfs to <mnt>, and copy /proc/vmcore to
893e0b
#             <mnt>/<path>/%HOST-%DATE/, supports DNS.
893e0b
#
893e0b
# ssh <user@server>
8f4abc
#           - Will save /proc/vmcore to <user@server>:<path>/%HOST-%DATE/,
893e0b
#             supports DNS.
893e0b
#             NOTE: make sure the user has write permissions on the server.
893e0b
#
893e0b
# sshkey <path>
893e0b
#           - Will use the sshkey to do ssh dump.
893e0b
#             Specify the path of the ssh key to use when dumping
893e0b
#             via ssh. The default value is /root/.ssh/kdump_id_rsa.
893e0b
#
893e0b
# <fs type> <partition>
893e0b
#           - Will mount -t <fs type> <partition> <mnt>, and copy
893e0b
#             /proc/vmcore to <mnt>/<path>/%DATE/.
893e0b
#             NOTE: <partition> can be a device node, label or uuid.
893e0b
#             It's recommended to use persistent device names
893e0b
#             such as /dev/vg/<devname>.
893e0b
#             Otherwise it's suggested to use label or uuid.
893e0b
#
893e0b
# path <path>
893e0b
#           - "path" represents the file system path in which vmcore
893e0b
#             will be saved.  If a dump target is specified in
893e0b
#             kdump.conf, then "path" is relative to the specified
893e0b
#             dump target.
893e0b
#
893e0b
#             Interpretation of "path" changes a bit if the user didn't
893e0b
#             specify any dump target explicitly in kdump.conf.  In this
893e0b
#             case, "path" represents the absolute path from root. The
893e0b
#             dump target and adjusted path are arrived at automatically
893e0b
#             depending on what's mounted in the current system.
893e0b
#
893e0b
#             Ignored for raw device dumps.  If unset, will use the default
893e0b
#             "/var/crash".
893e0b
#
893e0b
# core_collector <command> <options>
893e0b
#           - This allows you to specify the command to copy
893e0b
#             the vmcore.  The default is makedumpfile, which on
893e0b
#             some architectures can drastically reduce vmcore size.
893e0b
#             See /sbin/makedumpfile --help for a list of options.
893e0b
#             Note that the -i and -g options are not needed here,
893e0b
#             as the initrd will automatically be populated with a
893e0b
#             config file appropriate for the running kernel.
893e0b
#             The default core_collector for raw/ssh dump is:
8f4abc
#             "makedumpfile -F -l --message-level 7 -d 31".
893e0b
#             The default core_collector for other targets is:
8f4abc
#             "makedumpfile -l --message-level 7 -d 31".
893e0b
#
893e0b
#             "makedumpfile -F" will create a flattened vmcore.
893e0b
#             You need to use "makedumpfile -R" to rearrange the dump data to
893e0b
#             a normal dumpfile readable with analysis tools.  For example:
893e0b
#             "makedumpfile -R vmcore < vmcore.flat".
893e0b
#
893e0b
#             For core_collector format details, you can refer to
893e0b
#             kexec-kdump-howto.txt or kdump.conf manpage.
893e0b
#
893e0b
# kdump_post <binary | script>
893e0b
#           - This directive allows you to run a executable binary
893e0b
#             or script after the vmcore dump process terminates.
893e0b
#             The exit status of the current dump process is fed to
893e0b
#             the executable binary or script as its first argument.
f8bec6
#             All files under /etc/kdump/post.d are collectively sorted
f8bec6
#             and executed in lexical order, before binary or script
f8bec6
#             specified kdump_post parameter is executed.
893e0b
#
893e0b
# kdump_pre <binary | script>
893e0b
#           - Works like the "kdump_post" directive, but instead of running
893e0b
#             after the dump process, runs immediately before it.
893e0b
#             Exit status of this binary is interpreted as follows:
f8bec6
#               0 - continue with dump process as usual
f8bec6
#               non 0 - run the final action (reboot/poweroff/halt)
f8bec6
#             All files under /etc/kdump/pre.d are collectively sorted and
f8bec6
#             executed in lexical order, after binary or script specified
f8bec6
#             kdump_pre parameter is executed.
f8bec6
#             Even if the binary or script in /etc/kdump/pre.d directory
f8bec6
#             returns non 0 exit status, the processing is continued.
893e0b
#
893e0b
# extra_bins <binaries | shell scripts>
893e0b
#           - This directive allows you to specify additional binaries or
893e0b
#             shell scripts to be included in the kdump initrd.
893e0b
#             Generally they are useful in conjunction with a kdump_post
893e0b
#             or kdump_pre binary or script which depends on these extra_bins.
893e0b
#
893e0b
# extra_modules <module(s)>
893e0b
#           - This directive allows you to specify extra kernel modules
893e0b
#             that you want to be loaded in the kdump initrd.
893e0b
#             Multiple modules can be listed, separated by spaces, and any
893e0b
#             dependent modules will automatically be included.
893e0b
#
603de6
# failure_action <reboot | halt | poweroff | shell | dump_to_rootfs>
893e0b
#           - Action to perform in case dumping fails.
893e0b
#             reboot:   Reboot the system.
893e0b
#             halt:     Halt the system.
893e0b
#             poweroff: Power down the system.
893e0b
#             shell:    Drop to a bash shell.
603de6
#                       Exiting the shell reboots the system by default,
603de6
#                       or perform "final_action".
893e0b
#             dump_to_rootfs:  Dump vmcore to rootfs from initramfs context and
603de6
#                       reboot by default or perform "final_action".
603de6
#                       Useful when non-root dump target is specified.
893e0b
#             The default option is "reboot".
893e0b
#
603de6
# default <reboot | halt | poweroff | shell | dump_to_rootfs>
603de6
#           - Same as the "failure_action" directive above, but this directive
603de6
#             is obsolete and will be removed in the future.
603de6
#
603de6
# final_action <reboot | halt | poweroff>
603de6
#           - Action to perform in case dumping succeeds. Also performed
603de6
#             when "shell" or "dump_to_rootfs" failure action finishes.
603de6
#             Each action is same as the "failure_action" directive above.
603de6
#             The default is "reboot".
603de6
#
893e0b
# force_rebuild <0 | 1>
893e0b
#           - By default, kdump initrd will only be rebuilt when necessary.
893e0b
#             Specify 1 to force rebuilding kdump initrd every time when kdump
893e0b
#             service starts.
893e0b
#
893e0b
# force_no_rebuild <0 | 1>
893e0b
#           - By default, kdump initrd will be rebuilt when necessary.
893e0b
#             Specify 1 to bypass rebuilding of kdump initrd.
893e0b
#
893e0b
#             force_no_rebuild and force_rebuild options are mutually
893e0b
#             exclusive and they should not be set to 1 simultaneously.
893e0b
#
893e0b
# override_resettable <0 | 1>
893e0b
#           - Usually an unresettable block device can't be a dump target.
893e0b
#             Specifying 1 when you want to dump even though the block
893e0b
#             target is unresettable
893e0b
#             By default, it is 0, which will not try dumping destined to fail.
893e0b
#
893e0b
# dracut_args <arg(s)>
893e0b
#           - Pass extra dracut options when rebuilding kdump initrd.
893e0b
#
893e0b
# fence_kdump_args <arg(s)>
893e0b
#           - Command line arguments for fence_kdump_send (it can contain
893e0b
#             all valid arguments except hosts to send notification to).
893e0b
#
893e0b
# fence_kdump_nodes <node(s)>
893e0b
#           - List of cluster node(s) except localhost, separated by spaces,
893e0b
#             to send fence_kdump notifications to.
893e0b
#             (this option is mandatory to enable fence_kdump).
893e0b
#
893e0b
893e0b
#raw /dev/vg/lv_kdump
893e0b
#ext4 /dev/vg/lv_kdump
893e0b
#ext4 LABEL=/boot
893e0b
#ext4 UUID=03138356-5e61-4ab3-b58e-27507ac41937
893e0b
#nfs my.server.com:/export/tmp
8f4abc
#nfs [2001:db8::1:2:3:4]:/export/tmp
893e0b
#ssh user@my.server.com
8f4abc
#ssh user@2001:db8::1:2:3:4
893e0b
#sshkey /root/.ssh/kdump_id_rsa
893e0b
path /var/crash
8f4abc
core_collector makedumpfile -l --message-level 7 -d 31
893e0b
#core_collector scp
893e0b
#kdump_post /var/crash/scripts/kdump-post.sh
893e0b
#kdump_pre /var/crash/scripts/kdump-pre.sh
893e0b
#extra_bins /usr/bin/lftp
893e0b
#extra_modules gfs2
603de6
#failure_action shell
893e0b
#force_rebuild 1
893e0b
#force_no_rebuild 1
893e0b
#dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"
893e0b
#fence_kdump_args -p 7410 -f auto -c 0 -i 10
893e0b
#fence_kdump_nodes node1 node2