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

more clvmd rhel4 initscript cleanup

- don't echo after an 'action' call - action does the echo itself
 - use vgdisplay/vgs to determine which VGs are marked clustered and only
   deactivate those VGs (unless the LVM_VGS var is set in
   /etc/sysconfig/cluster)
This commit is contained in:
AJ Lewis 2005-05-11 15:21:44 +00:00
parent 17ae61cce5
commit fece730645

View File

@ -13,6 +13,8 @@
LVDISPLAY="/usr/sbin/lvdisplay"
VGCHANGE="/usr/sbin/vgchange"
VGSCAN="/usr/sbin/vgscan"
VGDISPLAY="/usr/sbin/vgdisplay"
VGS="/usr/sbin/vgs"
[ -f /etc/sysconfig/cluster ] && . /etc/sysconfig/cluster
@ -40,21 +42,15 @@ start()
then
for vg in $LVM_VGS
do
if action "Activating lvm $vg:" $VGCHANGE -ayl $vg
if ! action "Activating VG $vg:" $VGCHANGE -ayl $vg
then
echo;
else
rtrn=$?
echo;
fi
done
else
if action "Activating lvms:" $VGCHANGE -ayl
if ! action "Activating VGs:" $VGCHANGE -ayl
then
echo;
else
rtrn=$?
echo;
fi
fi
done
@ -70,22 +66,20 @@ stop()
then
for vg in $LVM_VGS
do
if action "Deactivating lvm $vg:" $VGCHANGE -anl $vg
if ! action "Deactivating VG $vg:" $VGCHANGE -anl $vg
then
echo;
else
rtrn=$?
echo;
fi
done
else
if action "Deactivating lvms:" if $VGCHANGE -anl
# Hack to only deactivate clustered volumes
clustervgs=`$VGDISPLAY \`$VGS --noheadings -o name\` | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
for vg in $clustervgs; do
if ! action "Deactivating VG $vg:" $VGCHANGE -anl $vg
then
echo;
else
rtrn=$?
echo;
fi
done
fi
[ $rtrn -ne 0 ] && break