----- Original Message -----
On 06/03/15 at 01:50pm, Qiao Zhao wrote:
> According to man page, default can only use reboot, halt, poweroff,
> shell and dump_to_rootfs as parameter.
> Currently, if configuration kdump.conf:
> ------
> path /var/crash
> core_collector makedumpfile -nosuchfile
> default no_such_option
> ------
> kdump service still can be start.
~ started.
>
> Add function "check_default_config" to kdumpctl file can solve
~Adding
> this problem.
>
> I have tested this patch in my test machine(Fedora-21).
>
> Signed-off-by: Qiao Zhao <qzhao(a)redhat.com>
> ---
> kdumpctl | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/kdumpctl b/kdumpctl
> index ca053a1..9bb8fe3 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -781,6 +781,21 @@ start_dump()
> return $?
> }
>
> +check_default_config()
> +{
> + local default_option
> +
> + default_option=$(awk '$1 ~ /^default$/ {print $2;}' $KDUMP_CONFIG_FILE)
Hi Qiao,
It's a good idea, but I just have one question: If the kdump.conf doesn't
configure the
'default *' option, maybe it will cause a kdump restart failed I guess.
------------
eg. # cat /etc/kdump.conf
# Configures where to put the kdump /proc/vmcore files
...
path /var/crash
core_collector makedumpfile -c --message-level 1 -d 31
...
#extra_modules gfs2
#options modulename options
#default shell
--------------
and the $default_option is void.
> + case "$default_option" in
> + reboot|halt|poweroff|shell|dump_to_rootfs)
> + return 0
> + ;;
> + *)
> + echo $"kdump.conf: default {reboot|halt|poweroff|shell|dump_to_rootfs}"
than will be come here :(
> + return 1
> + esac
> +}
> +
> start()
> {
> check_config
> @@ -817,6 +832,12 @@ start()
> fi
> fi
>
> + check_default_config
> + if [ $? -ne 0]; then
> + echo "Starting kdump: [FAILED]"
> + return 1
> + if
Could it be called in check_config()? Since default config is also one
of configs.
Yes, I agree! It's better to call the check_default_config() in check_config()
function.
Best,
Li Wang
Thanks
Baoquan
> +
> check_rebuild
> if [ $? != 0 ]; then
> echo "Starting kdump: [FAILED]"
> --
> 1.9.3
>
> _______________________________________________
> kexec mailing list
> kexec(a)lists.fedoraproject.org
>
https://lists.fedoraproject.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
kexec(a)lists.fedoraproject.org
https://lists.fedoraproject.org/mailman/listinfo/kexec