mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Make clvmd_fix_conf.sh UNDOable
This commit is contained in:
parent
0ef6cc3f82
commit
838ebb8378
@ -16,6 +16,7 @@ Version 2.00.27 - 24th November 2004
|
||||
Trap large memory allocation requests.
|
||||
Fix to partition table detection code.
|
||||
Improve filter debug mesgs.
|
||||
Make clvmd_fix_conf.sh UNDOable
|
||||
|
||||
Version 2.00.26 - 23rd November 2004
|
||||
====================================
|
||||
|
@ -15,7 +15,8 @@ if [ -z "$PREFIX" ]
|
||||
then
|
||||
echo "usage: $0 <prefix> [<config file>] [<library>]"
|
||||
echo ""
|
||||
echo "<prefix> location of the cluster locking shared library. (no default)"
|
||||
echo "<prefix>|UNDO location of the cluster locking shared library. (no default)"
|
||||
echo " UNDO will reset the locking back to local"
|
||||
echo "<config file> name of the LVM config file (default: /etc/lvm/lvm.conf)"
|
||||
echo "<library> name of the shared library (default: liblvm2clusterlock.so)"
|
||||
echo ""
|
||||
@ -25,23 +26,30 @@ fi
|
||||
[ -z "$LVMCONF" ] && LVMCONF="/etc/lvm/lvm.conf"
|
||||
[ -z "$LIB" ] && LIB="liblvm2clusterlock.so"
|
||||
|
||||
if [ "$PREFIX" = "UNDO" ]
|
||||
then
|
||||
locking_type="1"
|
||||
else
|
||||
locking_type="2"
|
||||
|
||||
if [ "${PREFIX:0:1}" != "/" ]
|
||||
then
|
||||
echo "Prefix must be an absolute path name (starting with a /)"
|
||||
exit 12
|
||||
fi
|
||||
|
||||
if [ ! -f "$LVMCONF" ]
|
||||
then
|
||||
echo "$LVMCONF does not exist"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
if [ ! -f "$PREFIX/$LIB" ]
|
||||
then
|
||||
echo "$PREFIX/$LIB does not exist, did you do a \"make install\" ?"
|
||||
exit 11
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "$LVMCONF" ]
|
||||
then
|
||||
echo "$LVMCONF does not exist"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
|
||||
SCRIPTFILE=`mktemp -t lvmscript.XXXXXXXXXX`
|
||||
@ -87,7 +95,7 @@ then
|
||||
cat $LVMCONF - <<EOF > $TMPFILE
|
||||
global {
|
||||
# Enable locking for cluster LVM
|
||||
locking_type = 2
|
||||
locking_type = $locking_type
|
||||
library_dir = "$PREFIX"
|
||||
locking_library = "$LIB"
|
||||
}
|
||||
@ -105,7 +113,7 @@ else
|
||||
|
||||
if [ "$have_type" = "0" ]
|
||||
then
|
||||
SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = 2/g"
|
||||
SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = $locking_type/g"
|
||||
else
|
||||
SEDCMD=" /global[[:blank:]]*{/a\ \ \ \ locking_type = 2"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user