"default" option only takes reboot/halt/poweroff/shell/dump_to_rootfs as its config value. Otherwise kdump service fails early.
Signed-off-by: WANG Chao chaowang@redhat.com --- kdumpctl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl index ee3214a..49ff98e 100755 --- a/kdumpctl +++ b/kdumpctl @@ -226,6 +226,22 @@ backup_initrd() fi }
+check_config_default_action() +{ + local default_action=$1 + + case "$default_action" in + reboot|halt|poweroff|shell|dump_to_rootfs) + ;; + *) + echo "Invalid kdump config value for option default" + return 1 + ;; + esac + + return 0 +} + check_config() { local nr @@ -242,7 +258,7 @@ check_config() case "$config_opt" in #* | "") ;; - raw|ext2|ext3|ext4|minix|btrfs|xfs|nfs|ssh|sshkey|path|core_collector|kdump_post|kdump_pre|extra_bins|extra_modules|default|force_rebuild|dracut_args|fence_kdump_args|fence_kdump_nodes) + raw|ext2|ext3|ext4|minix|btrfs|xfs|nfs|ssh|sshkey|path|core_collector|kdump_post|kdump_pre|extra_bins|extra_modules|force_rebuild|dracut_args|fence_kdump_args|fence_kdump_nodes) [ -z "$config_val" ] && { echo "Invalid kdump config value for option $config_opt." return 1; @@ -252,6 +268,9 @@ check_config() echo "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives." return 1 ;; + default) + check_config_default_action "$config_val" || return 1 + ;; *) echo "Invalid kdump config option $config_opt" return 1;