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