mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix a bug in lvm_dump.sh checks for lvm/dmsetup binaries quote the
invocations a bit more (although i'm fairly sure there are still quotes missing somewhere due to the eval in log).
This commit is contained in:
parent
cd3ae9bc99
commit
da08e40f8f
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.29 -
|
Version 2.02.29 -
|
||||||
==================================
|
==================================
|
||||||
|
Fix a bug in lvm_dump.sh checks for lvm/dmsetup binaries.
|
||||||
Refactor lvcreate stripe and mirror parameter validation.
|
Refactor lvcreate stripe and mirror parameter validation.
|
||||||
All tools: print --help output to stdout, not stderr.
|
All tools: print --help output to stdout, not stderr.
|
||||||
After a diagnostic, suggest --help, rather than printing all --help output.
|
After a diagnostic, suggest --help, rather than printing all --help output.
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
# the debugging of lvm issues.
|
# the debugging of lvm issues.
|
||||||
|
|
||||||
# following external commands are used throughout the script
|
# following external commands are used throughout the script
|
||||||
# which, echo and test are internal in bash at least
|
# echo and test are internal in bash at least
|
||||||
MKDIR=mkdir # need -p
|
MKDIR=mkdir # need -p
|
||||||
TAR=tar # need czf
|
TAR=tar # need czf
|
||||||
RM=rm # need -rf
|
RM=rm # need -rf
|
||||||
@ -43,12 +43,8 @@ die() {
|
|||||||
exit $code
|
exit $code
|
||||||
}
|
}
|
||||||
|
|
||||||
# which should error out if the binary is not executable, although i
|
"$LVM" version >& /dev/null || die 2 "Could not run lvm binary '$LVM'"
|
||||||
# am not sure we can rely on this
|
"$DMSETUP" help >& /dev/null || die 2 "Fatal: could not run dmsetup binary '$DMSETUP'"
|
||||||
which $LVM >& /dev/null || die 2 "Fatal: could not find lvm binary '$LVM'"
|
|
||||||
test -x `which $LVM` || die 2 "Fatal: lvm binary '$LVM' not executable"
|
|
||||||
which $DMSETUP >& /dev/null || die 2 "Fatal: could not find dmsetup binary '$DMSETUP'"
|
|
||||||
test -x `which $DMSETUP` || die 2 "Fatal: dmsetup binary '$DMSETUP' not executable"
|
|
||||||
|
|
||||||
function usage {
|
function usage {
|
||||||
echo "$0 [options]"
|
echo "$0 [options]"
|
||||||
@ -166,13 +162,13 @@ fi
|
|||||||
|
|
||||||
myecho "Gathering LVM & device-mapper version info..."
|
myecho "Gathering LVM & device-mapper version info..."
|
||||||
echo "LVM VERSION:" > $dir/versions
|
echo "LVM VERSION:" > $dir/versions
|
||||||
$LVM lvs --version >> $dir/versions 2>> $log
|
"$LVM" lvs --version >> $dir/versions 2>> $log
|
||||||
echo "DEVICE MAPPER VERSION:" >> $dir/versions
|
echo "DEVICE MAPPER VERSION:" >> $dir/versions
|
||||||
$DMSETUP --version >> $dir/versions 2>> $log
|
"$DMSETUP" --version >> $dir/versions 2>> $log
|
||||||
echo "KERNEL VERSION:" >> $dir/versions
|
echo "KERNEL VERSION:" >> $dir/versions
|
||||||
$UNAME -a >> $dir/versions 2>> $log
|
"$UNAME" -a >> $dir/versions 2>> $log
|
||||||
echo "DM TARGETS VERSIONS:" >> $dir/versions
|
echo "DM TARGETS VERSIONS:" >> $dir/versions
|
||||||
$DMSETUP targets >> $dir/versions 2>> $log
|
"$DMSETUP" targets >> $dir/versions 2>> $log
|
||||||
|
|
||||||
myecho "Gathering dmsetup info..."
|
myecho "Gathering dmsetup info..."
|
||||||
log "$DMSETUP info -c > $dir/dmsetup_info 2>> $log"
|
log "$DMSETUP info -c > $dir/dmsetup_info 2>> $log"
|
||||||
@ -215,9 +211,9 @@ fi
|
|||||||
if test -z "$userdir"; then
|
if test -z "$userdir"; then
|
||||||
lvm_dump="$dirbase.tgz"
|
lvm_dump="$dirbase.tgz"
|
||||||
myecho "Creating report tarball in $HOME/$lvm_dump..."
|
myecho "Creating report tarball in $HOME/$lvm_dump..."
|
||||||
cd $HOME
|
cd "$HOME"
|
||||||
$TAR czf $lvm_dump $dirbase 2>/dev/null
|
"$TAR" czf $lvm_dump $dirbase 2>/dev/null
|
||||||
$RM -rf $dir
|
"$RM" -rf $dir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$UID" != "0" && test "$EUID" != "0"; then
|
if test "$UID" != "0" && test "$EUID" != "0"; then
|
||||||
|
Loading…
Reference in New Issue
Block a user