Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 594144 Details for
Bug 788678
mkdumprd doesn't detect /var mounted on separate partion and kdump kernel fails
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed Patch v3
bz788678.diff (text/plain), 15.53 KB, created by
Cong Wang
on 2012-06-25 09:44:49 UTC
(
hide
)
Description:
Proposed Patch v3
Filename:
MIME Type:
Creator:
Cong Wang
Created:
2012-06-25 09:44:49 UTC
Size:
15.53 KB
patch
obsolete
> mkdumprd | 133 ++++++++++++++++++++++++++++---------------------------------- > 1 files changed, 60 insertions(+), 73 deletions(-) > >diff --git a/mkdumprd b/mkdumprd >index 395822c..8aed60d 100644 >--- a/mkdumprd >+++ b/mkdumprd >@@ -75,6 +75,7 @@ bin="" > KDUMP_POST="" > extra_kdump_mods="" > DUMP_FSTYPE="" >+DUMP_TARGET="" > > error() > { >@@ -1156,6 +1157,7 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > #find ethernet device used to route to remote host, ie eth0 > netdev=`/sbin/ip route get to $remoteip 2>&1` > [ $? != 0 ] && echo "Bad kdump location: $config_val" && cleanup_and_exit 1 >+ DUMP_TARGET=$config_val > #the field in the ip output changes if we go to another subnet > OFF_SUBNET=`echo $netdev | grep via` > if [ -n "$OFF_SUBNET" ] >@@ -1177,10 +1179,11 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > ;; > raw) > USING_METHOD="raw" >- if (echo $config_val | egrep -q "^(LABEL|UUID)="); then >- config_val=$(findfs "$config_val") >+ DUMP_TARGET="$config_val" >+ if (echo $DUMP_TARGET | egrep -q "^(LABEL|UUID)="); then >+ DUMP_TARGET=$(findfs "$DUMP_TARGET") > fi >- handlelvordev $config_val 0 >+ handlelvordev $DUMP_TARGET 0 > ;; > core_collector) > if [ -x /sbin/makedumpfile ]; then >@@ -1272,7 +1275,8 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > continue > fi > USING_METHOD="filesystem" >- DUMP_FSTYPE=$config_opt >+ DUMP_FSTYPE="$config_opt" >+ DUMP_TARGET="$config_val" > if [ "$config_opt" == "ext4" ] > then > findmodule ext4 >@@ -1317,6 +1321,21 @@ handle_default_action() > esac > } > >+# if no method was specified default to the currently booted filesystem >+if [ -z "$USING_METHOD" ] >+then >+ mkdir -p $SAVE_PATH >+ mntpoint=`df $SAVE_PATH | tail -1 | awk '{ print $NF }'` >+ DUMP_TARGET=`mount | awk '$3 == "'$mntpoint'" { print $1 }'` >+ DUMP_FSTYPE=`mount | awk '$3 == "'$mntpoint'" { print $5 }'` >+ handlelvordev $DUMP_TARGET 0 >+ if [ "$mntpoint" != "/" ] >+ then >+ SAVE_PATH=`echo $SAVE_PATH | sed "s,$mntpoint,,"` >+ fi >+fi >+ >+ > # If there are ISCSI devices found in dump target path, include some associated > # files and modules. > prepare_iscsi_target () { >@@ -2312,23 +2331,16 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > lib=/lib && [ -d "/lib64" -a "$ARCH" != "ppc64" ] && lib=/lib64 > k_extras="/$lib/libresolv.so.2 /$lib/libnss_compat.so.2 /$lib/libnss_files.so.2 /$lib/libnss_dns.so.2" > >- #traverse the config file and setup each dump location >- while read config_opt config_val; do >- [ -z "$config_opt" ] && continue #skip empty lines >- [ "`echo $config_opt | grep ^# `" ] && continue #skip comments >- >- case "$config_opt" in >- \#*) continue;; #skip comments >- >+ case "$USING_METHOD" in > raw) > #test raw partition >- kdump_chk "dd if=$config_val count=1 of=/dev/null > /dev/null 2>&1" \ >- "Bad raw partition $config_val" >+ kdump_chk "dd if=$DUMP_TARGET count=1 of=/dev/null > /dev/null 2>&1" \ >+ "Bad raw partition $DUMP_TARGET" > #check for available size is greater than $memtotal >- available_size=$(fdisk -s $config_val) >+ available_size=$(fdisk -s $DUMP_TARGET) > if [ $available_size -lt $memtotal ]; then > echo "Warning: There is not enough space to save a vmcore." >- echo " The size of $config_val should be much greater than $memtotal kilo bytes." >+ echo " The size of $DUMP_TARGET should be much greater than $memtotal kilo bytes." > fi > > #setup raw case >@@ -2341,15 +2353,15 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > emit " $FINAL_ACTION" > emit "fi" > fi >- emit "echo Saving to partition $config_val" >+ emit "echo Saving to partition $DUMP_TARGET" > emit "monitor_dd_progress 512 &" > emit "set -o pipefail" > if [ -z "$CORE_COLLECTOR" ] > then >- emit "dd if=/proc/vmcore of=$config_val bs=512 >> /tmp/dd_progress_file 2>&1" >+ emit "dd if=/proc/vmcore of=$DUMP_TARGET bs=512 >> /tmp/dd_progress_file 2>&1" > else > CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e's/\(^makedumpfile\)\(.*$\)/\1 -F \2/'` >- emit "$CORE_COLLECTOR /proc/vmcore | dd of=$config_val bs=512 >> /tmp/dd_progress_file 2>&1" >+ emit "$CORE_COLLECTOR /proc/vmcore | dd of=$DUMP_TARGET bs=512 >> /tmp/dd_progress_file 2>&1" > fi > emit "exitcode=\$?" > emit "if [ \$exitcode == 0 ]" >@@ -2363,20 +2375,20 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > emit "[ \$exitcode == 0 ] && $FINAL_ACTION" > ;; > >- net) >+ ssh|nfs) > #build an /etc/passwd for scp to work properly > grep "^root" /etc/passwd > $MNTIMAGE/etc/passwd > > emit_network > #grab remote host and xlate into numbers >- rhost=`echo $config_val | sed 's/.*@//' | cut -d':' -f1` >+ rhost=`echo $DUMP_TARGET | sed 's/.*@//' | cut -d':' -f1` > need_dns=`echo $rhost|grep "[a-zA-Z]"` > remoteip=$rhost > [ -n "$need_dns" ] && remoteip=`getent ahostsv4 $rhost|cut -d' ' -f1 | head -n 1` > > #find the local ip being used as a route to remote ip > netdev=`/sbin/ip route get to $remoteip 2>&1` >- [ $? != 0 ] && echo "Bad kdump location: $config_val" && cleanup_and_exit 1 >+ [ $? != 0 ] && echo "Bad kdump location: $DUMP_TARGET" && cleanup_and_exit 1 > OFF_SUBNET=`echo $netdev | grep via` > if [ -n "$OFF_SUBNET" ] > then >@@ -2387,17 +2399,17 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > lhost=`echo $netdev|awk '{print $5}'|head -n 1` > fi > >- emit "echo Saving to remote location $config_val" >- if [ -z "`echo $config_val|grep @`" ]; then >+ emit "echo Saving to remote location $DUMP_TARGET" >+ if [ -z "`echo $DUMP_TARGET |grep @`" ]; then > #NFS path > #test nfs mount and directory creation >- rlocation=`echo $config_val| sed 's/.*:/'"$remoteip"':/'` >+ rlocation=`echo $DUMP_TARGET | sed 's/.*:/'"$remoteip"':/'` > tmnt=`mktemp -dq` > kdump_chk "mount -t nfs -o nolock -o tcp $rlocation $tmnt" \ >- "Bad NFS mount $config_val" >- kdump_chk "mkdir -p $tmnt/$SAVE_PATH" "Read only NFS mount $config_val" >- kdump_chk "touch $tmnt/$SAVE_PATH/testfile" "Read only NFS mount $config_val" >- kdump_chk "rm -f $tmnt/$SAVE_PATH/testfile" "Read only NFS mount $config_val" >+ "Bad NFS mount $DUMP_TARGET" >+ kdump_chk "mkdir -p $tmnt/$SAVE_PATH" "Read only NFS mount $DUMP_TARGET" >+ kdump_chk "touch $tmnt/$SAVE_PATH/testfile" "Read only NFS mount $DUMP_TARGET" >+ kdump_chk "rm -f $tmnt/$SAVE_PATH/testfile" "Read only NFS mount $DUMP_TARGET" > > tdir=`mktemp -dqp $tmnt/$SAVE_PATH` > rc=$? >@@ -2412,7 +2424,7 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > fi > rm -rf $tmnt > if [ $rc != "0" ]; then >- echo "Cannot create directory in $config_val: $SAVE_PATH" >+ echo "Cannot create directory in $DUMP_TARGET: $SAVE_PATH" > cleanup_and_exit 1 > fi > >@@ -2423,7 +2435,7 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > #check for available size is greater than $memtotal > if [ $available_size -lt $memtotal ]; then > echo "Warning: There is not enough space to save a vmcore." >- echo " The size of $config_val should be much greater than $memtotal kilo bytes." >+ echo " The size of $DUMP_TARGET should be much greater than $memtotal kilo bytes." > fi > > #setup nfs case >@@ -2438,7 +2450,7 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > fi > > mkdir -p $MNTIMAGE/mnt >- emit "mount -t nfs -o nolock -o tcp $config_val /mnt" >+ emit "mount -t nfs -o nolock -o tcp $DUMP_TARGET /mnt" > emit "if [ \$? == 0 ]" > emit "then" > emit " mkdir -p /mnt/$SAVE_PATH/$lhost-\$DATE" >@@ -2460,21 +2472,21 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > emit "fi" > else > #SSH path >- #rebuild $config_val replacing machine name with ip address >+ #rebuild $DUMP_TARGET replacing machine name with ip address > if [ -n "$CORE_COLLECTOR" ] > then > CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e's/\(^makedumpfile\)\(.*$\)/\1 -F \2/'` > fi > > bin="$bin /usr/bin/ssh /usr/bin/scp" >- rlocation=`echo $config_val|sed 's/@.*/@'"$rhost"'/'` >+ rlocation=`echo $DUMP_TARGET |sed 's/@.*/@'"$rhost"'/'` > #test ssh path and directory creation > s_opts="-i $SSH_KEY_LOCATION -o BatchMode=yes" > kdump_chk "ssh -q $s_opts $rlocation mkdir -p $SAVE_PATH </dev/null" \ >- "Could not create $config_val:$SAVE_PATH, you probably need to run \"service kdump propagate\"" >+ "Could not create $DUMP_TARGET:$SAVE_PATH, you probably need to run \"service kdump propagate\"" > tdir=`ssh -q $s_opts $rlocation mktemp -dqp $SAVE_PATH </dev/null` > if [ $? != "0" ]; then >- echo "$KDUMP_CONFIG_FILE: Could not create temp directory in $config_val:$SAVE_PATH" >+ echo "$KDUMP_CONFIG_FILE: Could not create temp directory in $DUMP_TARGET:$SAVE_PATH" > cleanup_and_exit 1 > fi > >@@ -2533,44 +2545,20 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > emit "[ \$exitcode == 0 ] && $FINAL_ACTION" > fi > ;; >- core_collector) >- ;; >- kdump_pre) >- ;; >- kdump_post) >- ;; >- extra_bins) >- ;; >- extra_modules) >- ;; >- disk_timeout) >- ;; >- options) >- ;; >- default) >- ;; >- link_delay) >- ;; >- path) >- ;; >- blacklist) >- ;; >- sshkey) >- ;; > *) > #test filesystem and directory creation >- if [ "$config_opt" != "xfs" ] >+ if [ "$DUMP_FSTYPE" != "xfs" ] > then >- kdump_chk "test -f /sbin/fsck.$config_opt" "Unsupported type $config_opt: fsck.$config_opt not found" >+ kdump_chk "test -f /sbin/fsck.$DUMP_FSTYPE" "Unsupported type $DUMP_FSTYPE: fsck.$DUMP_FSTYPE not found" > fi >- if [ "$config_opt" == "ext4" ] >+ if [ "$DUMP_FSTYPE" == "ext4" ] > then > # rhel5 busybox lacks fsck.ext4 support so we need to pull it in > bin="$bin /sbin/fsck.ext4" > fi > > tmnt=`mktemp -dq` >- kdump_chk "mount -t $config_opt $config_val $tmnt" "Bad mount point $config_val" >+ kdump_chk "mount -t $DUMP_FSTYPE $DUMP_TARGET $tmnt" "Bad mount point $DUMP_TARGET" > mkdir -p $tmnt/$SAVE_PATH > tdir=`mktemp -dqp $tmnt/$SAVE_PATH` > rc=$? >@@ -2584,13 +2572,13 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > fi > rm -rf $tmnt > if [ $rc != "0" ]; then >- echo "Cannot create directory in $config_val: $SAVE_PATH" >+ echo "Cannot create directory in $DUMP_TARGET: $SAVE_PATH" > cleanup_and_exit 1 > fi > #check for available size is greater than $memtotal > if [ $available_size -lt $memtotal ]; then > echo "Warning: There is not enough space to save a vmcore." >- echo " The size of $config_val should be much greater than $memtotal kilo bytes." >+ echo " The size of $DUMP_TARGET should be much greater than $memtotal kilo bytes." > fi > > >@@ -2611,20 +2599,20 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > if [ -z "$CORE_COLLECTOR" ]; then > CORE_COLLECTOR="cp" > fi >- emit "echo Saving to the local filesystem $config_val" >- emit "DUMPDEV=$config_val" >+ emit "echo Saving to the local filesystem $DUMP_TARGET" >+ emit "DUMPDEV=$DUMP_TARGET" > emit "IS_LABEL=\`echo \$DUMPDEV | grep LABEL\`" > emit "IS_UUID=\`echo \$DUMPDEV | grep UUID\`" > emit "if [ -n \"\$IS_LABEL\" -o -n \"\$IS_UUID\" ] " > emit "then" > emit " DUMPDEV=\`findfs \"\$DUMPDEV\"\`" > emit "fi" >- if [ "$config_opt" = "xfs" ] ; then >+ if [ "$DUMP_FSTYPE" = "xfs" ] ; then > emit "# xfs does not need fsck" > else >- emit "fsck.$config_opt -y \$DUMPDEV" >+ emit "fsck.$DUMP_FSTYPE -y \$DUMPDEV" > fi >- emit "mount -t $config_opt \$DUMPDEV /mnt" >+ emit "mount -t $DUMP_FSTYPE \$DUMPDEV /mnt" > emit "if [ \$? == 0 ]" > emit "then" > emit " mkdir -p /mnt/$SAVE_PATH/127.0.0.1-\$DATE" >@@ -2648,8 +2636,7 @@ if [ -n "$KDUMP_CONFIG_FILE" ]; then > emit " [ \$exitcode == 0 ] && $FINAL_ACTION" > emit "fi" > ;; >- esac >- done < $KDUMP_CONFIG_FILE >+ esac > > #now handle the default action > handle_default_action
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 788678
:
593644
|
593683
|
594107
| 594144