Put the "/etc/sysconfig/kdump" stuff into a new function named
determine_kdump_sysconfig, and call it after single_instance_lock
before check_rebuild. We are going to modify this file in the
following patch, so as to avoid concurrency.
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
kdumpctl | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index cb6f004..dbdfef6 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -28,10 +28,6 @@ standard_kexec_args="-p"
# Some default values in case /etc/sysconfig/kdump doesn't include
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
-if [ -f /etc/sysconfig/kdump ]; then
- . /etc/sysconfig/kdump
-fi
-
single_instance_lock()
{
local rc timeout=5
@@ -58,6 +54,13 @@ determine_dump_mode()
fi
}
+determine_kdump_sysconfig()
+{
+ if [ -f /etc/sysconfig/kdump ]; then
+ . /etc/sysconfig/kdump
+ fi
+}
+
# remove_cmdline_param <kernel cmdline> <param1> [<param2>] ...
[<paramN>]
# Remove a list of kernel parameters from a given kernel cmdline and print the result.
# For each "arg" in the removing params list, "arg" and
"arg=xxx" will be removed if exists.
@@ -1084,6 +1087,9 @@ start()
fi
fi
+ # Determine configurations in /etc/sysconfig/kdump
+ determine_kdump_sysconfig
+
check_rebuild
if [ $? != 0 ]; then
echo "Starting kdump: [FAILED]"
--
1.8.3.1