From 56db773a09b5262b0686253f7f6101792f897dd4 Mon Sep 17 00:00:00 2001 From: AJ Lewis Date: Wed, 11 May 2005 15:21:44 +0000 Subject: [PATCH] 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) --- scripts/clvmd_init_rhel4 | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/scripts/clvmd_init_rhel4 b/scripts/clvmd_init_rhel4 index 66191cb6f..be16452c9 100644 --- a/scripts/clvmd_init_rhel4 +++ b/scripts/clvmd_init_rhel4 @@ -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 - then - echo; - else - rtrn=$? - echo; - fi + # 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 + rtrn=$? + fi + done fi [ $rtrn -ne 0 ] && break