raw core_collector fix
1. only append '-F' for default core_collector internally 2. error out if user does not add '-F' for makedumpfile v1->v2: refresh because of new core collector verify function v2->v3: optimize the code, remove local variable for default core_collector Signed-off-by: Dave Young <dyoung@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
2697669fa9
commit
b30eb78ab2
|
@ -93,7 +93,6 @@ dump_raw()
|
||||||
|
|
||||||
monitor_dd_progress $_src_size_mb &
|
monitor_dd_progress $_src_size_mb &
|
||||||
|
|
||||||
CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e's/\(^makedumpfile\)\(.*$\)/\1 -F \2/'`
|
|
||||||
$CORE_COLLECTOR /proc/vmcore | dd of=$1 bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1
|
$CORE_COLLECTOR /proc/vmcore | dd of=$1 bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -138,6 +137,11 @@ is_ssh_dump_target()
|
||||||
grep -q "^net.*@" $conf_file
|
grep -q "^net.*@" $conf_file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_raw_dump_target()
|
||||||
|
{
|
||||||
|
grep -q "^raw" $conf_file
|
||||||
|
}
|
||||||
|
|
||||||
read_kdump_conf()
|
read_kdump_conf()
|
||||||
{
|
{
|
||||||
if [ ! -f "$conf_file" ]; then
|
if [ ! -f "$conf_file" ]; then
|
||||||
|
@ -205,7 +209,9 @@ read_kdump_conf
|
||||||
|
|
||||||
if [ -z "$CORE_COLLECTOR" ];then
|
if [ -z "$CORE_COLLECTOR" ];then
|
||||||
CORE_COLLECTOR=$DEFAULT_CORE_COLLECTOR
|
CORE_COLLECTOR=$DEFAULT_CORE_COLLECTOR
|
||||||
is_ssh_dump_target && CORE_COLLECTOR="$CORE_COLLECTOR -F"
|
if is_ssh_dump_target || is_raw_dump_target; then
|
||||||
|
CORE_COLLECTOR="$CORE_COLLECTOR -F"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$DUMP_INSTRUCTION" ]; then
|
if [ -z "$DUMP_INSTRUCTION" ]; then
|
||||||
|
|
9
mkdumprd
9
mkdumprd
|
@ -96,17 +96,24 @@ is_ssh_dump_target()
|
||||||
grep -q "^net.*@" $conf_file
|
grep -q "^net.*@" $conf_file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_raw_dump_target()
|
||||||
|
{
|
||||||
|
grep -q "^raw" $conf_file
|
||||||
|
}
|
||||||
|
|
||||||
# $1: core_collector config value
|
# $1: core_collector config value
|
||||||
verify_core_collector() {
|
verify_core_collector() {
|
||||||
if grep -q "^raw" $conf_file && [ "${1%% *}" != "makedumpfile" ]; then
|
if grep -q "^raw" $conf_file && [ "${1%% *}" != "makedumpfile" ]; then
|
||||||
echo "Warning: specifying a non-makedumpfile core collector, you will have to recover the vmcore manually."
|
echo "Warning: specifying a non-makedumpfile core collector, you will have to recover the vmcore manually."
|
||||||
fi
|
fi
|
||||||
if is_ssh_dump_target && [ "${1%% *}" = "makedumpfile" ]; then
|
if is_ssh_dump_target || is_raw_dump_target; then
|
||||||
|
if [ "${1%% *}" = "makedumpfile" ]; then
|
||||||
! strstr "$1" "-F" && {
|
! strstr "$1" "-F" && {
|
||||||
echo "The specified dump target needs makedumpfile \"-F\" option."
|
echo "The specified dump target needs makedumpfile \"-F\" option."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
add_mount() {
|
add_mount() {
|
||||||
|
|
Loading…
Reference in New Issue