mkdumprd: fix default action handling
This commit is contained in:
parent
b9f39e444a
commit
b192a0d61b
@ -5,7 +5,7 @@
|
||||
set -x
|
||||
KDUMP_PATH="/var/crash"
|
||||
CORE_COLLECTOR="makedumpfile -d 31 -c"
|
||||
DEFAULT_ACTION="reboot -f"
|
||||
DEFAULT_ACTION="dump_rootfs"
|
||||
DATEDIR=`date +%d.%m.%y-%T`
|
||||
DUMP_INSTRUCTION=""
|
||||
|
||||
@ -57,7 +57,12 @@ dump_localfs()
|
||||
{
|
||||
local _dev=`to_dev_name $1`
|
||||
local _mp=`add_to_fstab $_dev`
|
||||
if [ $_mp = "$NEWROOT/" ] || [ $_mp = "$NEWROOT" ]
|
||||
then
|
||||
mount -o remount,rw $_mp || return 1
|
||||
else
|
||||
mount $_mp || return 1
|
||||
fi
|
||||
mkdir -p $_mp/$KDUMP_PATH/$DATEDIR
|
||||
$CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$DATEDIR/vmcore || return 1
|
||||
umount $_mp || return 1
|
||||
@ -77,6 +82,7 @@ dump_rootfs()
|
||||
mkdir -p $NEWROOT/$KDUMP_PATH/$DATEDIR
|
||||
$CORE_COLLECTOR /proc/vmcore $NEWROOT/$KDUMP_PATH/$DATEDIR/vmcore || return 1
|
||||
sync
|
||||
reboot -f
|
||||
return 0
|
||||
}
|
||||
|
||||
@ -150,10 +156,9 @@ read_kdump_conf
|
||||
|
||||
if [ -n "$DUMP_INSTRUCTION" ]
|
||||
then
|
||||
eval "$DUMP_INSTRUCTION"
|
||||
eval "$DUMP_INSTRUCTION && reboot -f"
|
||||
else
|
||||
dump_rootfs
|
||||
do_default_action
|
||||
fi
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
Name: kexec-tools
|
||||
Version: 2.0.2
|
||||
Release: 23%{?dist}
|
||||
Release: 24%{?dist}
|
||||
License: GPLv2
|
||||
Group: Applications/System
|
||||
Summary: The kexec/kdump userspace component.
|
||||
@ -280,6 +280,9 @@ done
|
||||
|
||||
|
||||
%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
|
||||
- Install modified kdump.conf in initrd.
|
||||
|
||||
|
2
sources
2
sources
@ -2,4 +2,4 @@ d9f2ecd3c3307905f24130a25816e6cc kexec-tools-2.0.0.tar.bz2
|
||||
3e802d638dce0080b910f15908c04a24 kexec-tools-po.tar.gz
|
||||
e3a813bd6d7dace903a05c1296e20d57 makedumpfile-1.3.5.tar.gz
|
||||
8e359dd03731b93a2082bd37cc2a4a4c kexec-tools-2.0.2.tar.bz2
|
||||
dccb3e4bfa087c2cad6d4eccaa452b66 dracut-files.tbz2
|
||||
ee3ecd074481933b8674d4e2163cd2fb dracut-files.tbz2
|
||||
|
Loading…
Reference in New Issue
Block a user