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 -
=====================================
Separate --enable-cluster from locking lib options in lvmconf.sh.
Add a missing comma in lvcreate man page.
Version 2.02.10 - 19th September 2006

View File

@ -1,6 +1,6 @@
#!/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.
#
@ -21,8 +21,9 @@ function usage
echo "usage: $0 <command>"
echo ""
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 "Set locking library: --lockinglibdir <dir> [--lockinglib <lib>]"
echo ""
echo "Global options:"
echo "Config file location: --file <configfile>"
@ -86,14 +87,13 @@ function validate_args
exit 10
fi
if [ -z "$LOCKING_TYPE" ]; then
if [ -z "$LOCKING_TYPE" ] && [ -z "$LOCKINGLIBDIR" ]; then
usage
exit 1
fi
if [ "$LOCKING_TYPE" == "2" ]; then
if [ -n "$LOCKINGLIBDIR" ]; then
[ -z "$LOCKINGLIBDIR" ] && usage && exit 1
[ -z "$LOCKINGLIB" ] && LOCKINGLIB="liblvm2clusterlock.so"
if [ "${LOCKINGLIBDIR:0:1}" != "/" ]
@ -109,6 +109,10 @@ function validate_args
fi
fi
if [ "$LOCKING_TYPE" = "1" ] && [ -n "$LOCKINGLIBDIR" -o -n "$LOCKINGLIB" ]; then
echo "Superfluous locking lib parameter, ignoring"
fi
}
umask 0077
@ -153,11 +157,19 @@ then
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
# populate it
if [ "$have_global" = "1" ]
then
if [ -z "$LOCKING_TYPE" ]; then
LOCKING_TYPE=1
fi
if [ "$LOCKING_TYPE" = "2" ]; then
cat $CONFIGFILE - <<EOF > $TMPFILE
global {
@ -180,14 +192,16 @@ else
# locking entries as appropriate
#
if [ "$have_type" = "0" ]
then
SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = $LOCKING_TYPE/g"
else
SEDCMD=" /global[[:blank:]]*{/a\ \ \ \ locking_type = $LOCKING_TYPE"
if [ -n "$LOCKING_TYPE" ]; then
if [ "$have_type" = "0" ]
then
SEDCMD=" s/^[[:blank:]]*locking_type[[:blank:]]*=.*/\ \ \ \ locking_type = $LOCKING_TYPE/g"
else
SEDCMD=" /global[[:blank:]]*{/a\ \ \ \ locking_type = $LOCKING_TYPE"
fi
fi
if [ "$LOCKING_TYPE" = "2" ]; then
if [ -n "$LOCKINGLIBDIR" ]; then
if [ "$have_dir" = "0" ]
then
SEDCMD="${SEDCMD}\ns'^[[:blank:]]*library_dir[[:blank:]]*=.*'\ \ \ \ library_dir = \"$LOCKINGLIBDIR\"'g"
@ -201,7 +215,9 @@ else
else
SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ locking_library = \"$LOCKINGLIB\""
fi
else
fi
if [ "$LOCKING_TYPE" = "1" ]; then
# if we're not using cluster locking, remove the library dir and locking library name
if [ "$have_dir" = "0" ]
then