On 02/08/15 at 11:23pm, Joe Lawrence wrote:
Dump destination directory prefix "127.0.0.1" doesn't
add any useful
information in the local dump_fs case. Remove it so that it agrees with
kdump.conf(5) documentation for <fs type> <partition> option, which states
the target directory format as "/mnt/var/crash/%DATE/".
We intend to use 127.0.1 in below commit, I guess for compability issue.
Baoquan?
commit 3be6c1228e822fca98a72dac4e51893d164244e4
Author: Baoquan He <bhe(a)redhat.com>
Date: Thu Dec 13 13:47:56 2012 +0800
change the dump dir format to be more readable
Signed-off-by: Joe Lawrence <joe.lawrence(a)stratus.com>
Reported-by: Charlotte Richardson <charlotte.richardson(a)stratus.com>
---
kdump-lib-initramfs.sh | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index 57b8304217cd..f657d836afa6 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -8,7 +8,6 @@ DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 1 -d
31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
DEFAULT_ACTION="reboot"
DATEDIR=`date +%Y.%m.%d-%T`
-HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
KDUMP_SCRIPT_DIR="/kdumpscripts"
@@ -87,6 +86,7 @@ dump_fs()
local _dev=$(findmnt -k -f -n -r -o SOURCE $1)
local _mp=$(findmnt -k -f -n -r -o TARGET $1)
+ local _dir=""
echo "kdump: dump target is $_dev"
@@ -95,19 +95,25 @@ dump_fs()
return 1
fi
+ if [ -z "$HOST_IP" ]; then
+ _dir="$_mp/$KDUMP_PATH/$DATEDIR"
+ else
+ _dir="$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR"
+ fi
+
# Remove -F in makedumpfile case. We don't want a flat format dump here.
[[ $CORE_COLLECTOR = *makedumpfile* ]] && CORE_COLLECTOR=`echo
$CORE_COLLECTOR | sed -e "s/-F//g"`
- echo "kdump: saving to $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/"
+ echo "kdump: saving to $_dir/"
mount -o remount,rw $_mp || return 1
- mkdir -p $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR || return 1
+ mkdir -p $_dir || return 1
- save_vmcore_dmesg_fs ${DMESG_COLLECTOR}
"$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/"
+ save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dir/"
echo "kdump: saving vmcore"
- $CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete ||
return 1
- mv $_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore-incomplete
$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/vmcore
+ $CORE_COLLECTOR /proc/vmcore $_dir/vmcore-incomplete || return 1
+ mv $_dir/vmcore-incomplete $_dir/vmcore
sync
echo "kdump: saving vmcore complete"
--
1.7.10.4