mkdumprd: fix default action handling

This commit is contained in:
Amerigo Wang 2011-08-02 18:10:16 +08:00
parent b9f39e444a
commit b192a0d61b
3 changed files with 14 additions and 6 deletions

View File

@ -5,7 +5,7 @@
set -x set -x
KDUMP_PATH="/var/crash" KDUMP_PATH="/var/crash"
CORE_COLLECTOR="makedumpfile -d 31 -c" CORE_COLLECTOR="makedumpfile -d 31 -c"
DEFAULT_ACTION="reboot -f" DEFAULT_ACTION="dump_rootfs"
DATEDIR=`date +%d.%m.%y-%T` DATEDIR=`date +%d.%m.%y-%T`
DUMP_INSTRUCTION="" DUMP_INSTRUCTION=""
@ -57,7 +57,12 @@ dump_localfs()
{ {
local _dev=`to_dev_name $1` local _dev=`to_dev_name $1`
local _mp=`add_to_fstab $_dev` local _mp=`add_to_fstab $_dev`
if [ $_mp = "$NEWROOT/" ] || [ $_mp = "$NEWROOT" ]
then
mount -o remount,rw $_mp || return 1
else
mount $_mp || return 1 mount $_mp || return 1
fi
mkdir -p $_mp/$KDUMP_PATH/$DATEDIR mkdir -p $_mp/$KDUMP_PATH/$DATEDIR
$CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$DATEDIR/vmcore || return 1 $CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$DATEDIR/vmcore || return 1
umount $_mp || return 1 umount $_mp || return 1
@ -77,6 +82,7 @@ dump_rootfs()
mkdir -p $NEWROOT/$KDUMP_PATH/$DATEDIR mkdir -p $NEWROOT/$KDUMP_PATH/$DATEDIR
$CORE_COLLECTOR /proc/vmcore $NEWROOT/$KDUMP_PATH/$DATEDIR/vmcore || return 1 $CORE_COLLECTOR /proc/vmcore $NEWROOT/$KDUMP_PATH/$DATEDIR/vmcore || return 1
sync sync
reboot -f
return 0 return 0
} }
@ -150,10 +156,9 @@ read_kdump_conf
if [ -n "$DUMP_INSTRUCTION" ] if [ -n "$DUMP_INSTRUCTION" ]
then then
eval "$DUMP_INSTRUCTION" eval "$DUMP_INSTRUCTION && reboot -f"
else else
dump_rootfs dump_rootfs
do_default_action
fi fi

View File

@ -1,6 +1,6 @@
Name: kexec-tools Name: kexec-tools
Version: 2.0.2 Version: 2.0.2
Release: 23%{?dist} Release: 24%{?dist}
License: GPLv2 License: GPLv2
Group: Applications/System Group: Applications/System
Summary: The kexec/kdump userspace component. Summary: The kexec/kdump userspace component.
@ -280,6 +280,9 @@ done
%changelog %changelog
* Tue Aug 2 2011 Cong Wang <xiyou.wangcong@gmail.com> - 2.0.2-24
- Fix default action handling.
* Tue Aug 2 2011 Cong Wang <xiyou.wangcong@gmail.com> - 2.0.2-23 * Tue Aug 2 2011 Cong Wang <xiyou.wangcong@gmail.com> - 2.0.2-23
- Install modified kdump.conf in initrd. - Install modified kdump.conf in initrd.

View File

@ -2,4 +2,4 @@ d9f2ecd3c3307905f24130a25816e6cc kexec-tools-2.0.0.tar.bz2
3e802d638dce0080b910f15908c04a24 kexec-tools-po.tar.gz 3e802d638dce0080b910f15908c04a24 kexec-tools-po.tar.gz
e3a813bd6d7dace903a05c1296e20d57 makedumpfile-1.3.5.tar.gz e3a813bd6d7dace903a05c1296e20d57 makedumpfile-1.3.5.tar.gz
8e359dd03731b93a2082bd37cc2a4a4c kexec-tools-2.0.2.tar.bz2 8e359dd03731b93a2082bd37cc2a4a4c kexec-tools-2.0.2.tar.bz2
dccb3e4bfa087c2cad6d4eccaa452b66 dracut-files.tbz2 ee3ecd074481933b8674d4e2163cd2fb dracut-files.tbz2