[PATCH v2] kdumpctl: eliminate redundant lsinitrd in dracut
by Ziyue Yang
Currently in Fedora/RedHat dracut installs its fedora.conf.example
as the default config file, in which sysloglvl is set 5. This leads
to maxloglvl=5 in dracut calls, making unnecessary lsinitrd calls
during initramfs builds.
This patch makes use of --conf and --confdir arguments of dracut,
creates temp config directory before mkdumprd(dracut) calls. It
appends sysloglvl=0 option by creating a 99-kdumpctl.conf file in
the temp config directory.
1) Before this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
/etc/kdump.conf
Rebuilding /boot/initramfs-4.10.10-200.fc25.x86_64kdump.img 4.10.10-200.fc25_x86_64
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m18.716s
user 0m13.863s
sys 0m3.269s
2) After this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
/etc/kdump.conf
Rebuilding /boot/initramfs-4.10.10-200.fc25.x86_64kdump.img 4.10.10-200.fc25_x86_64
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m13.665s
user 0m10.945s
sys 0m2.907s
Signed-off-by: Ziyue Yang <ziyang(a)redhat.com>
---
kdumpctl | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 4d6b3e8..a37db01 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -5,7 +5,6 @@ KDUMP_KERNELVER=""
KDUMP_COMMANDLINE=""
KEXEC_ARGS=""
KDUMP_CONFIG_FILE="/etc/kdump.conf"
-MKDUMPRD="/sbin/mkdumprd -f"
SAVE_PATH=/var/crash
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
@@ -20,6 +19,18 @@ DEFAULT_DUMP_MODE="kdump"
image_time=0
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
+
+# lower dracut's default sysloglvl to speedup initramfs build
+DRACUT_SYSLOGLVL="3"
+# make temp dir for dracut conf files
+[[ $dracutconfdir ]] || dracutconfdir=/tmp/kdumpctl.dracut.conf
+mkdir -p $dracutconfdir/dracut.conf.d
+[[ -e $dracutbasedir/dracut.conf.d ]] && cp -rf $dracutbasedir/dracut.conf.d $dracutconfdir/
+[[ -e $dracutbasedir/dracut.conf ]] && cp -rf $dracutbasedir/dracut.conf $dracutconfdir/
+echo "sysloglvl=$DRACUT_SYSLOGLVL" > $dracutconfdir/dracut.conf.d/99-kdumpctl.conf
+
+MKDUMPRD="/sbin/mkdumprd --conf $dracutconfdir/dracut.conf --confdir $dracutconfdir/dracut.conf.d -f"
+
. $dracutbasedir/dracut-functions.sh
. /lib/kdump/kdump-lib.sh
@@ -284,6 +295,9 @@ rebuild_initrd()
rebuild_kdump_initrd
fi
+ # delete tmp conf folder for dracut
+ rm -rf /tmp/kdumpctl.dracut.conf
+
return $?
}
--
2.9.3
6 years, 11 months
[PATCH v2] kdumpctl: eliminate redundant lsinitrd in dracut
by Ziyue Yang
Currently in Fedora/RedHat dracut installs its fedora.conf.example
as the default config file, in which sysloglvl is set 5. This leads
to maxloglvl=5 in dracut calls, making unnecessary lsinitrd calls
during initramfs builds.
This patch makes use of --conf and --confdir arguments of dracut,
creates temp config directory before mkdumprd(dracut) calls. It
appends sysloglvl=0 option by creating a 99-kdumpctl.conf file in
the temp config directory.
1) Before this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
/etc/kdump.conf
Rebuilding /boot/initramfs-4.10.10-200.fc25.x86_64kdump.img 4.10.10-200.fc25_x86_64
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m18.716s
user 0m13.863s
sys 0m3.269s
2) After this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
/etc/kdump.conf
Rebuilding /boot/initramfs-4.10.10-200.fc25.x86_64kdump.img 4.10.10-200.fc25_x86_64
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m13.665s
user 0m10.945s
sys 0m2.907s
Signed-off-by: Ziyue Yang <ziyang(a)redhat.com>
---
kdumpctl | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 4d6b3e8..a37db01 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -5,7 +5,6 @@ KDUMP_KERNELVER=""
KDUMP_COMMANDLINE=""
KEXEC_ARGS=""
KDUMP_CONFIG_FILE="/etc/kdump.conf"
-MKDUMPRD="/sbin/mkdumprd -f"
SAVE_PATH=/var/crash
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
@@ -20,6 +19,18 @@ DEFAULT_DUMP_MODE="kdump"
image_time=0
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
+
+# lower dracut's default sysloglvl to speedup initramfs build
+DRACUT_SYSLOGLVL="3"
+# make temp dir for dracut conf files
+[[ $dracutconfdir ]] || dracutconfdir=/tmp/kdumpctl.dracut.conf
+mkdir -p $dracutconfdir/dracut.conf.d
+[[ -e $dracutbasedir/dracut.conf.d ]] && cp -rf $dracutbasedir/dracut.conf.d $dracutconfdir/
+[[ -e $dracutbasedir/dracut.conf ]] && cp -rf $dracutbasedir/dracut.conf $dracutconfdir/
+echo "sysloglvl=$DRACUT_SYSLOGLVL" > $dracutconfdir/dracut.conf.d/99-kdumpctl.conf
+
+MKDUMPRD="/sbin/mkdumprd --conf $dracutconfdir/dracut.conf --confdir $dracutconfdir/dracut.conf.d -f"
+
. $dracutbasedir/dracut-functions.sh
. /lib/kdump/kdump-lib.sh
@@ -284,6 +295,9 @@ rebuild_initrd()
rebuild_kdump_initrd
fi
+ # delete tmp conf folder for dracut
+ rm -rf /tmp/kdumpctl.dracut.conf
+
return $?
}
--
2.9.3
6 years, 11 months
[PATCH v2] kdumpctl: eliminate redundant lsinitrd in dracut
by Ziyue Yang
Currently in Fedora/RedHat dracut installs its fedora.conf.example
as the default config file, in which sysloglvl is set 5. This leads
to maxloglvl=5 in dracut calls, making unnecessary lsinitrd calls
during initramfs builds.
This patch makes use of --conf and --confdir arguments of dracut,
creates temp config directory before mkdumprd(dracut) calls. It
appends sysloglvl=0 option by creating a 99-kdumpctl.conf file in
the temp config directory.
1) Before this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
/etc/kdump.conf
Rebuilding /boot/initramfs-4.10.10-200.fc25.x86_64kdump.img 4.10.10-200.fc25_x86_64
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m18.716s
user 0m13.863s
sys 0m3.269s
2) After this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
/etc/kdump.conf
Rebuilding /boot/initramfs-4.10.10-200.fc25.x86_64kdump.img 4.10.10-200.fc25_x86_64
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m13.665s
user 0m10.945s
sys 0m2.907s
Signed-off-by: Ziyue Yang <ziyang(a)redhat.com>
---
kdumpctl | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 4d6b3e8..defd57e 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -5,7 +5,6 @@ KDUMP_KERNELVER=""
KDUMP_COMMANDLINE=""
KEXEC_ARGS=""
KDUMP_CONFIG_FILE="/etc/kdump.conf"
-MKDUMPRD="/sbin/mkdumprd -f"
SAVE_PATH=/var/crash
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
@@ -20,6 +19,18 @@ DEFAULT_DUMP_MODE="kdump"
image_time=0
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
+
+# lower dracut's default sysloglvl to speedup initramfs build
+DRACUT_SYSLOGLVL="2"
+# make temp dir for dracut conf files
+[[ $dracutconfdir ]] || dracutconfdir=/tmp/kdumpctl.dracut.conf
+mkdir -p $dracutconfdir/dracut.conf.d
+[[ -e $dracutbasedir/dracut.conf.d ]] && cp -rf $dracutbasedir/dracut.conf.d $dracutconfdir/
+[[ -e $dracutbasedir/dracut.conf ]] && cp -rf $dracutbasedir/dracut.conf $dracutconfdir/
+echo "sysloglvl=$DRACUT_SYSLOGLVL" > $dracutconfdir/dracut.conf.d/99-kdumpctl.conf
+
+MKDUMPRD="/sbin/mkdumprd --conf $dracutconfdir/dracut.conf --confdir $dracutconfdir/dracut.conf.d -f"
+
. $dracutbasedir/dracut-functions.sh
. /lib/kdump/kdump-lib.sh
@@ -284,6 +295,9 @@ rebuild_initrd()
rebuild_kdump_initrd
fi
+ # delete tmp conf folder for dracut
+ rm -rf /tmp/kdumpctl.dracut.conf
+
return $?
}
--
2.9.3
6 years, 11 months
[PATCH] kdumpctl: eliminate redundant lsinitrd in dracut
by Ziyue Yang
Currently in Fedora/RedHat dracut installs its fedora.conf.example
as the default config file, in which sysloglvl is set 5. This leads
to maxloglvl=5 in dracut calls, making unnecessary lsinitrd calls
during initramfs builds.
This patch makes use of --conf and --confdir arguments of dracut,
creates temp config directory before mkdumprd(dracut) calls. It
appends sysloglvl=0 option by creating a 99-kdumpctl.conf file in
the temp config directory.
1) Before this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
/etc/kdump.conf
Rebuilding /boot/initramfs-4.10.10-200.fc25.x86_64kdump.img 4.10.10-200.fc25_x86_64
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m18.716s
user 0m13.863s
sys 0m3.269s
2) After this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
/etc/kdump.conf
Rebuilding /boot/initramfs-4.10.10-200.fc25.x86_64kdump.img 4.10.10-200.fc25_x86_64
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m13.665s
user 0m10.945s
sys 0m2.907s
Signed-off-by: Ziyue Yang <ziyang(a)redhat.com>
---
kdumpctl | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 4d6b3e8..0612294 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -5,7 +5,6 @@ KDUMP_KERNELVER=""
KDUMP_COMMANDLINE=""
KEXEC_ARGS=""
KDUMP_CONFIG_FILE="/etc/kdump.conf"
-MKDUMPRD="/sbin/mkdumprd -f"
SAVE_PATH=/var/crash
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
@@ -20,6 +19,18 @@ DEFAULT_DUMP_MODE="kdump"
image_time=0
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
+
+# lower dracut's default sysloglvl to speedup initramfs build
+DRACUT_SYSLOGLVL="0"
+# make temp dir for dracut conf files
+[[ $dracutconfdir ]] || dracutconfdir=/tmp/kdumpctl.dracut.conf
+mkdir -p $dracutconfdir/dracut.conf.d
+[[ -e $dracutbasedir/dracut.conf.d ]] && cp -rf $dracutbasedir/dracut.conf.d $dracutconfdir/
+[[ -e $dracutbasedir/dracut.conf ]] && cp -rf $dracutbasedir/dracut.conf $dracutconfdir/
+echo "sysloglvl=$DRACUT_SYSLOGLVL" > $dracutconfdir/dracut.conf.d/99-kdumpctl.conf
+
+MKDUMPRD="/sbin/mkdumprd --conf $dracutconfdir/dracut.conf --confdir $dracutconfdir/dracut.conf.d -f"
+
. $dracutbasedir/dracut-functions.sh
. /lib/kdump/kdump-lib.sh
@@ -284,6 +295,9 @@ rebuild_initrd()
rebuild_kdump_initrd
fi
+ # delete tmp conf folder for dracut
+ rm -rf /tmp/kdumpctl.dracut.conf
+
return $?
}
--
2.9.3
6 years, 11 months
[PATCH] kdumpctl: for fence_kdump, the ipaddr of this node should be excluded from list
by Pingfan Liu
Since user can use ipaddr of a node instead of its hostname, so we need
to protect from this case.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump.conf | 4 ++--
kdumpctl | 7 +++++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/kdump.conf b/kdump.conf
index 1e24e1b..cfdaec7 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -137,8 +137,8 @@
#
# fence_kdump_nodes <node(s)>
# - List of cluster node(s), separated by spaces, to send
-# fence_kdump notifications to (this option is mandatory to
-# enable fence_kdump).
+# fence_kdump notifications to. The list should exclude this node itself!
+# (this option is mandatory to enable fence_kdump).
#
#raw /dev/vg/lv_kdump
diff --git a/kdumpctl b/kdumpctl
index d43f46b..638c6b6 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1118,6 +1118,7 @@ check_kdump_feasibility()
check_fence_kdump_config()
{
local hostname=`hostname`
+ local ipaddrs=`hostname -i`
local nodes=$(get_option_value "fence_kdump_nodes")
for node in $nodes; do
@@ -1125,6 +1126,12 @@ check_fence_kdump_config()
echo "Option fence_kdump_nodes cannot contain $hostname"
return 1
fi
+ # node can be ipaddr
+ echo $ipaddrs | grep $node
+ if [ $? -eq 0 ]; then
+ echo "Option fence_kdump_nodes cannot contain $node"
+ return 1
+ fi
done
return 0
--
2.7.4
6 years, 11 months
[PATCH v3 0/4] optimize kdump service start time in case of no initramfs rebuild
by Xunlei Pang
kdump service takes a few seconds to start even no need to rebuild initramfs,
which is a little longer compared to other systemd services, it may affects
the system boot time a little, we better optimize it as possible as we can.
The main root cause of this is the use of "lsinitrd" which is time-consuming.
This series is mainly reducing the "lsinitrd" uses.
The time data in this series is on Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz.
After this series, kdump service start time in case of no initramfs rebuild
is 1s~2s, it should be good enough considering the service is indeed running
parallelly with others.
Before this patchset:
$ time kdumpctl start
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m5.156s
user 0m5.169s
sys 0m1.269s
After this patchset:
$ time kdumpctl start
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m1.151s
user 0m1.028s
sys 0m0.300s
There are still two lsinitrd operations(each consumes around 0.35s) remaining,
we can reconsider it if there are still complaints in the future.
Xunlei Pang (4):
kdumpctl: remove is_mode_switched()
kdumpctl: improve check_wdt_modified()
kdumpctl: update check_dump_fs_modified() to use "lsinitrd -f"
kdumpctl: improve "while read" time for /etc/kdump.conf
kdumpctl | 115 +++++++++++++++++++++++++++++++--------------------------------
1 file changed, 57 insertions(+), 58 deletions(-)
--
1.8.3.1
6 years, 11 months
[PATCH v2 0/3] optimize kdump service start time in case of no initramfs rebuild
by Xunlei Pang
kdump service takes a few seconds to start even no need to rebuild initramfs,
which is a little longer compared to other systemd services, it may affects
the system boot time a little, we better optimize it as possible as we can.
The main root cause of this is the use of "lsinitrd" which is time-consuming.
This series is actually reducing the "lsinitrd" uses.
Tested on Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz.
Before this patchset:
$ time kdumpctl start
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m5.156s
user 0m5.169s
sys 0m1.269s
After this patchset:
$ time kdumpctl start (when kdump lsinitrd tmp file exists)
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m0.854s
user 0m0.389s
sys 0m0.582s
Xunlei Pang (3):
kdumpctl: remove is_mode_switched()
kdumpctl: improve check_wdt_modified()
introduce kdump lsinitrd support
dracut-module-setup.sh | 5 +++
kdump-lib.sh | 26 +++++++++++++++
kdumpctl | 88 +++++++++++++++++++++++---------------------------
mkdumprd | 7 ++++
4 files changed, 78 insertions(+), 48 deletions(-)
--
1.8.3.1
6 years, 11 months
[PATCH v2 4/3] kdumpctl: improve "while read" time for /etc/kdump.conf
by Xunlei Pang
I found using "cat $KDUMP_CONFIG_FILE|grep -v "^#"|while read ..."
instead of "while read ... do ...; done < $KDUMP_CONFIG_FILE" will
make the script run faster.
(in case of no initramfs rebuild)
Before this patchset:
$ time kdumpctl start
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m0.854s
user 0m0.389s
sys 0m0.582s
After this patchset:
$ time kdumpctl start
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m0.465s
user 0m0.305s
sys 0m0.194s
Now most of start time is consumed by kexec syscall(around 0.330s)
which is impossible for us to optimize from kdump side.
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
Please append to "[PATCH v2 0/3] optimize kdump service start time in case of no initramfs rebuild".
kdumpctl | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 11d7f1f..d075a1a 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -365,7 +365,7 @@ check_config()
return 1
}
- while read config_opt config_val; do
+ cat $KDUMP_CONFIG_FILE | grep -v "^#" | while read config_opt config_val; do
# remove inline comments after the end of a directive.
config_val=$(strip_comments $config_val)
case "$config_opt" in
@@ -386,7 +386,7 @@ check_config()
return 1;
;;
esac
- done < $KDUMP_CONFIG_FILE
+ done
check_default_config || return 1
@@ -792,7 +792,7 @@ load_kdump()
check_ssh_config()
{
- while read config_opt config_val; do
+ cat $KDUMP_CONFIG_FILE | grep -v "^#" | while read config_opt config_val; do
# remove inline comments after the end of a directive.
config_val=$(strip_comments $config_val)
case "$config_opt" in
@@ -813,7 +813,7 @@ check_ssh_config()
*)
;;
esac
- done < $KDUMP_CONFIG_FILE
+ done
#make sure they've configured kdump.conf for ssh dumps
local SSH_TARGET=`echo -n $DUMP_TARGET | sed -n '/.*@/p'`
--
1.8.3.1
6 years, 11 months
[PATCH 0/4] optimize kdump service start time in case of no initramfs rebuild
by Xunlei Pang
kdump service takes a few seconds to start even no need to rebuild initramfs,
which is a little longer compared to other systemd services, it may affects
the system boot time a little, we better optimize it as possible as we can.
Before this patchset:
$ time kdumpctl start
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m5.156s
user 0m5.169s
sys 0m1.269s
After this patchset:
$ time kdumpctl start (when kdump lsinitrd tmp file exists)
kexec: loaded kdump kernel
Starting kdump: [OK]
real 0m0.854s
user 0m0.389s
sys 0m0.582s
Xunlei Pang (4):
kdumpctl: remove is_mode_switched()
kdumpctl: improve check_wdt_modified()
kdumpctl: update check_dump_fs_modified() to use "lsinitrd -f"
introduce kdump lsinitrd support
dracut-module-setup.sh | 5 +++
kdump-lib.sh | 26 ++++++++++++
kdumpctl | 107 ++++++++++++++++++++++++-------------------------
mkdumprd | 6 +++
4 files changed, 90 insertions(+), 54 deletions(-)
--
1.8.3.1
6 years, 11 months
[PATCH] kdumpctl: bail out earlier in case of no reserved memory
by Xunlei Pang
Some cloud people complained that VM boot speed is slower than
Ubuntu and other distributions, after some debugging, we found
that one of the causes is kdump service starts too slow(7seconds
according to the test result on the test VM), actually there is
no "crashkernel=X" specified. Although kdump service is parallel,
it affects the speed more or less especially on VMs with few cpus,
which is unacceptable. It is even worse when kdump initramfs is
built out in case of no reserved memory at first boot.
Commit afa4a35d3 ("kdumpctrl: kdump feasibility should fail if no
crash memory") can actually solve this issue.
This patch is a supplement of above-mentioned commit, we bail out
start() even earlier in case of no reserved memory.
Also made some cosmatic changes for check_crash_mem_reserved().
1) Before this patch
$ time kdumpctl start
No memory reserved for crash kernel.
Starting kdump: [FAILED]
real 0m0.282s
user 0m0.184s
sys 0m0.146s
2) After this patch
$ time kdumpctl start
No memory reserved for crash kernel
Starting kdump: [FAILED]
real 0m0.010s
user 0m0.008s
sys 0m0.001s
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
kdumpctl | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 6b5be09..129cb6a 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1074,10 +1074,11 @@ is_secure_boot_enforced()
check_crash_mem_reserved()
{
- MEM_RESERVED=$(cat /sys/kernel/kexec_crash_size)
- if [ $MEM_RESERVED -eq 0 ]
- then
- echo "No memory reserved for crash kernel." >&2
+ local mem_reserved
+
+ mem_reserved=$(cat /sys/kernel/kexec_crash_size)
+ if [ $mem_reserved -eq 0 ]; then
+ echo "No memory reserved for crash kernel"
return 1
fi
@@ -1163,22 +1164,23 @@ check_default_config()
start()
{
- check_config
+ check_dump_feasibility
if [ $? -ne 0 ]; then
echo "Starting kdump: [FAILED]"
return 1
fi
- if sestatus 2>/dev/null | grep -q "SELinux status.*enabled"; then
- selinux_relabel
- fi
- save_raw
+ check_config
if [ $? -ne 0 ]; then
echo "Starting kdump: [FAILED]"
return 1
fi
- check_dump_feasibility
+ if sestatus 2>/dev/null | grep -q "SELinux status.*enabled"; then
+ selinux_relabel
+ fi
+
+ save_raw
if [ $? -ne 0 ]; then
echo "Starting kdump: [FAILED]"
return 1
--
1.8.3.1
6 years, 11 months