diff --git a/WHATS_NEW b/WHATS_NEW index 893c3822f..242c17dc8 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.115 - ===================================== + Use LVM's own selection instead of awk expressions in clvmd startup scripts. Do not filter out snapshot origin LVs as unusable devices for an LVM stack. Fix incorrect rimage names when converting from mirror to raid1 LV (2.02.112). Avoid excessive re-reading of metadata and related error messages in pvremove. diff --git a/scripts/clvmd_init_red_hat.in b/scripts/clvmd_init_red_hat.in index 8c46c0665..d7f339240 100644 --- a/scripts/clvmd_init_red_hat.in +++ b/scripts/clvmd_init_red_hat.in @@ -24,9 +24,9 @@ exec_prefix=@exec_prefix@ sbindir=@sbindir@ lvm_vgchange=${sbindir}/vgchange -lvm_vgdisplay=${sbindir}/vgdisplay +lvm_vgs=${sbindir}/vgs lvm_vgscan=${sbindir}/vgscan -lvm_lvdisplay=${sbindir}/lvdisplay +lvm_lvs=${sbindir}/lvs CLVMDOPTS="-T30" @@ -42,17 +42,12 @@ CLVMDOPTS="-T30" LOCK_FILE="/var/lock/subsys/$DAEMON" -# NOTE: replace this with vgs, once display filter per attr is implemented. clustered_vgs() { - ${lvm_vgdisplay} 2>/dev/null | \ - awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}' + ${lvm_vgs} --noheadings -o vg_name -S 'vg_clustered=1' 2>/dev/null } clustered_active_lvs() { - for i in $(clustered_vgs); do - ${lvm_lvdisplay} $i 2>/dev/null | \ - awk 'BEGIN {RS="LV Name"} {if (/[^N^O^T] available/) print $1;}' - done + ${lvm_lvs} --noheadings -o lv_name -S 'vg_clustered=1 && lv_active!=""' 2>/dev/null } rh_status() { diff --git a/scripts/lvm2_cluster_activation_red_hat.sh.in b/scripts/lvm2_cluster_activation_red_hat.sh.in index 0d4676c41..abea02682 100644 --- a/scripts/lvm2_cluster_activation_red_hat.sh.in +++ b/scripts/lvm2_cluster_activation_red_hat.sh.in @@ -7,16 +7,8 @@ lvm_vgscan=${sbindir}/vgscan lvm_vgs=${sbindir}/vgs lvm_lvm=${sbindir}/lvm -parse_clustered_vgs() { - while read -r name attrs; - do - test "${attrs:5:1}" == 'c' && echo -n "$name " - done -} - -# NOTE: replace this with vgs, once display filter per attr is implemented. clustered_vgs() { - ${lvm_vgs} -o vg_name,vg_attr --noheadings | parse_clustered_vgs + ${lvm_vgs} --noheadings -o vg_name -S 'vg_clustered=1' 2>/dev/null } activate() {