All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix clvmd init script status
@ 2010-06-23 11:30 Milan Broz
  2010-06-23 12:06 ` Zdenek Kabelac
  0 siblings, 1 reply; 2+ messages in thread
From: Milan Broz @ 2010-06-23 11:30 UTC (permalink / raw)
  To: lvm-devel

- s/Active clustred VG/clustered VG/ (only LV can be active)

- print only active LVs (not all) in status command
(In the lvdisplay form /dev/vg/lv.)

For now, still use awk (already used in clustered_vgs).

https://bugzilla.redhat.com/show_bug.cgi?id=598495
---
 scripts/clvmd_init_red_hat.in |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/clvmd_init_red_hat.in b/scripts/clvmd_init_red_hat.in
index 1a03984..da09a34 100644
--- a/scripts/clvmd_init_red_hat.in
+++ b/scripts/clvmd_init_red_hat.in
@@ -25,7 +25,7 @@ sbindir=@sbindir@
 lvm_vgchange=${sbindir}/vgchange
 lvm_vgdisplay=${sbindir}/vgdisplay
 lvm_vgscan=${sbindir}/vgscan
-lvm_lvs=${sbindir}/lvs
+lvm_lvdisplay=${sbindir}/lvdisplay
 
 CLVMDOPTS="-T30"
 
@@ -47,9 +47,10 @@ clustered_vgs() {
 		awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'
 }
 
-clustered_lvs() {
+clustered_active_lvs() {
 	for i in $(clustered_vgs); do
-		${lvm_lvs} -o lv_name --noheadings $i
+		${lvm_lvdisplay} $i 2>/dev/null | \
+		awk 'BEGIN {RS="LV Name"} {if (/[^N^O^T] available/) print $1;}'
 	done
 }
 
@@ -197,8 +198,8 @@ case "$1" in
 	rtrn=$?
 	if [ $rtrn = 0 ]; then
 		cvgs="$(clustered_vgs)"
-		echo Active clustered Volume Groups: ${cvgs:-"(none)"}
-		clvs="$(clustered_lvs)"
+		echo Clustered Volume Groups: ${cvgs:-"(none)"}
+		clvs="$(clustered_active_lvs)"
 		echo Active clustered Logical Volumes: ${clvs:-"(none)"}
 	fi
 	;;
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] Fix clvmd init script status
  2010-06-23 11:30 [PATCH] Fix clvmd init script status Milan Broz
@ 2010-06-23 12:06 ` Zdenek Kabelac
  0 siblings, 0 replies; 2+ messages in thread
From: Zdenek Kabelac @ 2010-06-23 12:06 UTC (permalink / raw)
  To: lvm-devel

Dne 23.6.2010 13:30, Milan Broz napsal(a):
> - s/Active clustred VG/clustered VG/ (only LV can be active)
>
> - print only active LVs (not all) in status command
> (In the lvdisplay form /dev/vg/lv.)
>
> For now, still use awk (already used in clustered_vgs).
>
> https://bugzilla.redhat.com/show_bug.cgi?id=598495
> ---
>   scripts/clvmd_init_red_hat.in |   11 ++++++-----
>   1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/clvmd_init_red_hat.in b/scripts/clvmd_init_red_hat.in
> index 1a03984..da09a34 100644


Ack

Future version should be probably able to decode everything using just one 
scan commmand.

Zdenek



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-23 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-23 11:30 [PATCH] Fix clvmd init script status Milan Broz
2010-06-23 12:06 ` Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.