- Remove no-longer-used ldconfig from lvm2-cluster and fix lvmconf to cope

without the shared library.
This commit is contained in:
Alasdair Kergon 2006-10-20 21:15:26 +00:00
parent d3740602d9
commit d5e095c339
2 changed files with 89 additions and 10 deletions

View File

@ -1,5 +1,5 @@
--- LVM2.2.02.11-old/scripts/lvmconf.sh 2006-09-20 18:36:47.000000000 +0100 --- LVM2.2.02.12-old/scripts/lvmconf.sh 2006-09-20 18:36:47.000000000 +0100
+++ LVM2.2.02.11/scripts/lvmconf.sh 2006-10-14 16:57:06.000000000 +0100 +++ LVM2.2.02.12/scripts/lvmconf.sh 2006-10-20 19:20:26.000000000 +0100
@@ -36,7 +36,7 @@ function parse_args @@ -36,7 +36,7 @@ function parse_args
while [ -n "$1" ]; do while [ -n "$1" ]; do
case $1 in case $1 in
@ -9,12 +9,92 @@
shift shift
;; ;;
--disable-cluster) --disable-cluster)
@@ -170,7 +170,7 @@ then @@ -94,15 +94,13 @@ function validate_args
if [ -n "$LOCKINGLIBDIR" ]; then
- [ -z "$LOCKINGLIB" ] && LOCKINGLIB="liblvm2clusterlock.so"
-
if [ "${LOCKINGLIBDIR:0:1}" != "/" ]
then
echo "Prefix must be an absolute path name (starting with a /)"
exit 12
fi
- if [ ! -f "$LOCKINGLIBDIR/$LOCKINGLIB" ]
+ if [ -n "$LOCKINGLIB" ] && [ ! -f "$LOCKINGLIBDIR/$LOCKINGLIB" ]
then
echo "$LOCKINGLIBDIR/$LOCKINGLIB does not exist, did you do a \"make install\" ?"
exit 11
@@ -170,13 +168,29 @@ then
if [ -z "$LOCKING_TYPE" ]; then if [ -z "$LOCKING_TYPE" ]; then
LOCKING_TYPE=1 LOCKING_TYPE=1
fi fi
- if [ "$LOCKING_TYPE" = "2" ]; then - if [ "$LOCKING_TYPE" = "2" ]; then
+ if [ "$LOCKING_TYPE" = "3" ]; then + if [ "$LOCKING_TYPE" = "3" ] || [ "$LOCKING_TYPE" = "2" ]; then
cat $CONFIGFILE - <<EOF > $TMPFILE cat $CONFIGFILE - <<EOF > $TMPFILE
global { global {
# Enable locking for cluster LVM # Enable locking for cluster LVM
locking_type = $LOCKING_TYPE
library_dir = "$LOCKINGLIBDIR"
+EOF
+ if [ $? != 0 ]
+ then
+ echo "failed to create temporary config file, $CONFIGFILE not updated"
+ exit 14
+ fi
+ if [ -n "$LOCKINGLIB" ]; then
+ cat - <<EOF >> $TMPFILE
locking_library = "$LOCKINGLIB"
+EOF
+ if [ $? != 0 ]
+ then
+ echo "failed to create temporary config file, $CONFIGFILE not updated"
+ exit 16
+ fi
+ fi
+ cat - <<EOF >> $TMPFILE
}
EOF
fi # if we aren't setting cluster locking, we don't need to create a global section
@@ -184,7 +198,7 @@ EOF
if [ $? != 0 ]
then
echo "failed to create temporary config file, $CONFIGFILE not updated"
- exit 14
+ exit 17
fi
else
#
@@ -208,8 +222,10 @@ else
else
SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ library_dir = \"$LOCKINGLIBDIR\""
fi
+ fi
- if [ "$have_library" = "0" ]
+ if [ -n "$LOCKINGLIB" ]; then
+ if [ "$have_library" = "0" ]
then
SEDCMD="${SEDCMD}\ns/^[[:blank:]]*locking_library[[:blank:]]*=.*/\ \ \ \ locking_library = \"$LOCKINGLIB\"/g"
else
@@ -217,19 +233,6 @@ else
fi
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
- SEDCMD="${SEDCMD}\n/^[[:blank:]]*library_dir[[:blank:]]*=.*/d"
- fi
-
- if [ "$have_library" = "0" ]
- then
- SEDCMD="${SEDCMD}\n/^[[:blank:]]*locking_library[[:blank:]]*=.*/d"
- fi
- fi
-
echo -e $SEDCMD > $SCRIPTFILE
sed <$CONFIGFILE >$TMPFILE -f $SCRIPTFILE
if [ $? != 0 ]

View File

@ -3,7 +3,7 @@
Summary: Userland logical volume management tools Summary: Userland logical volume management tools
Name: lvm2 Name: lvm2
Version: 2.02.12 Version: 2.02.12
Release: 1%{?dist} Release: 2%{?dist}
License: GPL License: GPL
Group: System Environment/Base Group: System Environment/Base
URL: http://sources.redhat.com/lvm2 URL: http://sources.redhat.com/lvm2
@ -89,23 +89,18 @@ Summary: Cluster extensions for userland logical volume management tools
Group: System Environment/Base Group: System Environment/Base
Requires: lvm2 = %{version}-%{release} Requires: lvm2 = %{version}-%{release}
Requires(post): chkconfig Requires(post): chkconfig
Requires(post): ldconfig
Requires(preun): chkconfig Requires(preun): chkconfig
Requires(preun): device-mapper >= %{device_mapper_version} Requires(preun): device-mapper >= %{device_mapper_version}
Requires(preun): lvm2 >= 2.02 Requires(preun): lvm2 >= 2.02
Requires(postun): ldconfig
%description cluster %description cluster
Extensions to LVM2 to support clusters. Extensions to LVM2 to support clusters.
%post cluster %post cluster
/sbin/chkconfig --add clvmd /sbin/chkconfig --add clvmd
/sbin/ldconfig
/usr/sbin/lvmconf --lockinglibdir %{_libdir} /usr/sbin/lvmconf --lockinglibdir %{_libdir}
%postun cluster -p /sbin/ldconfig
%preun cluster %preun cluster
if [ "$1" = 0 ]; then if [ "$1" = 0 ]; then
/sbin/chkconfig --del clvmd /sbin/chkconfig --del clvmd
@ -121,6 +116,10 @@ fi
%changelog %changelog
* Fri Oct 20 2006 Alasdair Kergon <agk@redhat.com> - 2.02.12-2
- Remove no-longer-used ldconfig from lvm2-cluster and fix lvmconf
to cope without the shared library.
* Mon Oct 16 2006 Alasdair Kergon <agk@redhat.com> - 2.02.12-1 * Mon Oct 16 2006 Alasdair Kergon <agk@redhat.com> - 2.02.12-1
- New upstream. - New upstream.