1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Separate --enable-cluster from locking lib options in lvmconf.sh.

This commit is contained in:
Alasdair Kergon 2006-09-20 17:36:47 +00:00
parent d1a1e1a319
commit e0a266927d
2 changed files with 29 additions and 12 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.11 - Version 2.02.11 -
===================================== =====================================
Separate --enable-cluster from locking lib options in lvmconf.sh.
Add a missing comma in lvcreate man page. Add a missing comma in lvcreate man page.
Version 2.02.10 - 19th September 2006 Version 2.02.10 - 19th September 2006

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. # Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
# #
# This file is part of the lvm2-cluster package. # This file is part of the lvm2-cluster package.
# #
@ -21,8 +21,9 @@ function usage
echo "usage: $0 <command>" echo "usage: $0 <command>"
echo "" echo ""
echo "Commands:" echo "Commands:"
echo "Enable clvm: --enable-cluster --lockinglibdir <dir> [--lockinglib <lib>]" echo "Enable clvm: --enable-cluster [--lockinglibdir <dir>] [--lockinglib <lib>]"
echo "Disable clvm: --disable-cluster" echo "Disable clvm: --disable-cluster"
echo "Set locking library: --lockinglibdir <dir> [--lockinglib <lib>]"
echo "" echo ""
echo "Global options:" echo "Global options:"
echo "Config file location: --file <configfile>" echo "Config file location: --file <configfile>"
@ -86,14 +87,13 @@ function validate_args
exit 10 exit 10
fi fi
if [ -z "$LOCKING_TYPE" ]; then if [ -z "$LOCKING_TYPE" ] && [ -z "$LOCKINGLIBDIR" ]; then
usage usage
exit 1 exit 1
fi fi
if [ "$LOCKING_TYPE" == "2" ]; then if [ -n "$LOCKINGLIBDIR" ]; then
[ -z "$LOCKINGLIBDIR" ] && usage && exit 1
[ -z "$LOCKINGLIB" ] && LOCKINGLIB="liblvm2clusterlock.so" [ -z "$LOCKINGLIB" ] && LOCKINGLIB="liblvm2clusterlock.so"
if [ "${LOCKINGLIBDIR:0:1}" != "/" ] if [ "${LOCKINGLIBDIR:0:1}" != "/" ]
@ -109,6 +109,10 @@ function validate_args
fi fi
fi fi
if [ "$LOCKING_TYPE" = "1" ] && [ -n "$LOCKINGLIBDIR" -o -n "$LOCKINGLIB" ]; then
echo "Superfluous locking lib parameter, ignoring"
fi
} }
umask 0077 umask 0077
@ -153,11 +157,19 @@ then
fi fi
fi fi
if [ "$LOCKING_TYPE" = "2" ] && [ -z "$LOCKINGLIBDIR" ] && [ "$have_dir" = "1" ]; then
echo "no library_dir specified in $CONFIGFILE"
exit 16
fi
# So if we don't have "global {" we need to create one and # So if we don't have "global {" we need to create one and
# populate it # populate it
if [ "$have_global" = "1" ] if [ "$have_global" = "1" ]
then then
if [ -z "$LOCKING_TYPE" ]; then
LOCKING_TYPE=1
fi
if [ "$LOCKING_TYPE" = "2" ]; then if [ "$LOCKING_TYPE" = "2" ]; then
cat $CONFIGFILE - <<EOF > $TMPFILE cat $CONFIGFILE - <<EOF > $TMPFILE
global { global {
@ -180,14 +192,16 @@ else
# locking entries as appropriate # locking entries as appropriate
# #
if [ "$have_type" = "0" ] if [ -n "$LOCKING_TYPE" ]; then
then if [ "$have_type" = "0" ]
SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = $LOCKING_TYPE/g" then
else SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = $LOCKING_TYPE/g"
SEDCMD=" /global[[:blank:]]*{/a\ \ \ \ locking_type = $LOCKING_TYPE" else
SEDCMD=" /global[[:blank:]]*{/a\ \ \ \ locking_type = $LOCKING_TYPE"
fi
fi fi
if [ "$LOCKING_TYPE" = "2" ]; then if [ -n "$LOCKINGLIBDIR" ]; then
if [ "$have_dir" = "0" ] if [ "$have_dir" = "0" ]
then then
SEDCMD="${SEDCMD}\ns'^[[:blank:]]*library_dir[[:blank:]]*=.*'\ \ \ \ library_dir = \"$LOCKINGLIBDIR\"'g" SEDCMD="${SEDCMD}\ns'^[[:blank:]]*library_dir[[:blank:]]*=.*'\ \ \ \ library_dir = \"$LOCKINGLIBDIR\"'g"
@ -201,7 +215,9 @@ else
else else
SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ locking_library = \"$LOCKINGLIB\"" SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ locking_library = \"$LOCKINGLIB\""
fi fi
else fi
if [ "$LOCKING_TYPE" = "1" ]; then
# if we're not using cluster locking, remove the library dir and locking library name # if we're not using cluster locking, remove the library dir and locking library name
if [ "$have_dir" = "0" ] if [ "$have_dir" = "0" ]
then then