According to man page, default option can only use reboot, halt, poweroff, shell and dump_to_rootfs as parameter. Currently, if configuration kdump.conf is: ------ path /var/crash core_collector makedumpfile -nosuchfile default no_such_option ------ kdump service still can be started.
Adding function "check_default_config" to kdumpctl file can solve this problem.
I have tested this patch in my test machine(Fedora-21).
v1 --> v2 Baoquan He point "check_default_config" function should be call in "check_config" function. Wang Li point if kdump.conf donesn't configure the "default" option, kdump serivce will fail.
Signed-off-by: Qiao Zhao qzhao@redhat.com --- kdumpctl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/kdumpctl b/kdumpctl index ca053a1..eaf7f67 100755 --- a/kdumpctl +++ b/kdumpctl @@ -259,6 +259,8 @@ check_config() esac done < $KDUMP_CONFIG_FILE
+ check_default_config || return 1 + check_fence_kdump_config || return 1
return 0 @@ -781,6 +783,25 @@ start_dump() return $? }
+check_default_config() +{ + local default_option + + default_option=$(awk '$1 ~ /^default$/ {print $2;}' $KDUMP_CONFIG_FILE) + if [ -z "$default_option" ]; then + return 0 + else + case "$default_option" in + reboot|halt|poweroff|shell|dump_to_rootfs) + return 0 + ;; + *) + echo $"Usage kdump.conf: default {reboot|halt|poweroff|shell|dump_to_rootfs}" + return 1 + esac + fi +} + start() { check_config
On 06/09/15 at 01:32pm, Qiao Zhao wrote:
According to man page, default option can only use reboot, halt, poweroff, shell and dump_to_rootfs as parameter. Currently, if configuration kdump.conf is:
path /var/crash core_collector makedumpfile -nosuchfile default no_such_option
kdump service still can be started.
Adding function "check_default_config" to kdumpctl file can solve this problem.
I have tested this patch in my test machine(Fedora-21).
Patch looks good to me, ack.
Acked-by: Baoquan He bhe@redhat.com
Thanks Baoquan
v1 --> v2 Baoquan He point "check_default_config" function should be call in "check_config" function. Wang Li point if kdump.conf donesn't configure the "default" option, kdump serivce will fail.
Signed-off-by: Qiao Zhao qzhao@redhat.com
kdumpctl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/kdumpctl b/kdumpctl index ca053a1..eaf7f67 100755 --- a/kdumpctl +++ b/kdumpctl @@ -259,6 +259,8 @@ check_config() esac done < $KDUMP_CONFIG_FILE
check_default_config || return 1
check_fence_kdump_config || return 1
return 0
@@ -781,6 +783,25 @@ start_dump() return $? }
+check_default_config() +{
- local default_option
- default_option=$(awk '$1 ~ /^default$/ {print $2;}' $KDUMP_CONFIG_FILE)
- if [ -z "$default_option" ]; then
return 0
- else
case "$default_option" in
reboot|halt|poweroff|shell|dump_to_rootfs)
return 0
;;
*)
echo $"Usage kdump.conf: default {reboot|halt|poweroff|shell|dump_to_rootfs}"
return 1
esac
- fi
+}
start() { check_config -- 1.9.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
Acked-by: Minfei Huang mhuang@redhat.com
On 06/09/15 at 01:32pm, Qiao Zhao wrote:
According to man page, default option can only use reboot, halt, poweroff, shell and dump_to_rootfs as parameter. Currently, if configuration kdump.conf is:
path /var/crash core_collector makedumpfile -nosuchfile default no_such_option
kdump service still can be started.
Adding function "check_default_config" to kdumpctl file can solve this problem.
I have tested this patch in my test machine(Fedora-21).
v1 --> v2 Baoquan He point "check_default_config" function should be call in "check_config" function. Wang Li point if kdump.conf donesn't configure the "default" option, kdump serivce will fail.
Signed-off-by: Qiao Zhao qzhao@redhat.com
kdumpctl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/kdumpctl b/kdumpctl index ca053a1..eaf7f67 100755 --- a/kdumpctl +++ b/kdumpctl @@ -259,6 +259,8 @@ check_config() esac done < $KDUMP_CONFIG_FILE
check_default_config || return 1
check_fence_kdump_config || return 1
return 0
@@ -781,6 +783,25 @@ start_dump() return $? }
+check_default_config() +{
- local default_option
- default_option=$(awk '$1 ~ /^default$/ {print $2;}' $KDUMP_CONFIG_FILE)
- if [ -z "$default_option" ]; then
return 0
- else
case "$default_option" in
reboot|halt|poweroff|shell|dump_to_rootfs)
return 0
;;
*)
echo $"Usage kdump.conf: default {reboot|halt|poweroff|shell|dump_to_rootfs}"
return 1
esac
- fi
+}
start() { check_config -- 1.9.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec