All of lore.kernel.org
 help / color / mirror / Atom feed
From: meyering@sourceware.org <meyering@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/scripts lvm_dump.sh
Date: 20 Aug 2007 12:06:36 -0000	[thread overview]
Message-ID: <20070820120636.29293.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	meyering at sourceware.org	2007-08-20 12:06:36

Modified files:
	scripts        : lvm_dump.sh 

Log message:
	factor out some duplication -- mostly I/O redirection

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/lvm_dump.sh.diff?cvsroot=lvm2&r1=1.7&r2=1.8

--- LVM2/scripts/lvm_dump.sh	2007/08/09 09:53:33	1.7
+++ LVM2/scripts/lvm_dump.sh	2007/08/20 12:06:35	1.8
@@ -116,45 +116,40 @@
 
 if (( $clustered )); then
 	myecho "Gathering cluster info..."
-	echo "NODES: " > $dir/cluster_info
-	echo "----------------------------------" >> $dir/cluster_info
-	log "cman_tool nodes >> $dir/cluster_info 2>> $log"
-	echo " " >> $dir/cluster_info
-
-	echo "STATUS: " > $dir/cluster_info
-	echo "----------------------------------" >> $dir/cluster_info
-	log "cman_tool status >> $dir/cluster_info 2>> $log"
-	echo " " >> $dir/cluster_info
-
-	echo "SERVICES: " >> $dir/cluster_info
-	echo "----------------------------------" >> $dir/cluster_info
-	log "cman_tool services >> $dir/cluster_info 2>> $log"
-	echo " " >> $dir/cluster_info
 
-	echo "LOCKS: "  >> $dir/cluster_info
-	echo "----------------------------------" >> $dir/cluster_info
+	{
+	for i in nodes status services; do
+		cap_i=$(echo $i|tr a-z A-Z)
+		printf "$cap_i:\n----------------------------------\n"
+		log "cman_tool $i 2>> $log"
+		echo
+	done
+
+	echo "LOCKS:"
+	echo "----------------------------------"
 	if [ -f /proc/cluster/dlm_locks ]
 	then
-		echo "clvmd" > /proc/cluster/dlm_locks
-		cat /proc/cluster/dlm_locks >> $dir/cluster_info
-		echo " " >> $dir/cluster_info
-		echo "RESOURCE DIR: "  >> $dir/cluster_info
-		cat /proc/cluster/dlm_dir >> $dir/cluster_info
-		echo " " >> $dir/cluster_info
-		echo "DEBUG LOG: "  >> $dir/cluster_info
-		cat /proc/cluster/dlm_debug >> $dir/cluster_info
-		echo " " >> $dir/cluster_info
+		echo clvmd > /proc/cluster/dlm_locks
+		cat /proc/cluster/dlm_locks
+		echo
+		echo "RESOURCE DIR:"
+		cat /proc/cluster/dlm_dir
+		echo
+		echo "DEBUG LOG:"
+		cat /proc/cluster/dlm_debug
+		echo
 	fi
 	if [ -f /debug/dlm/clvmd ]
 	then
-		cat /debug/dlm/clvmd >> $dir/cluster_info
-		echo " " >> $dir/cluster_info
-		echo "WAITERS: "  >> $dir/cluster_info
-		cat /debug/dlm/clvmd_waiters >> $dir/cluster_info
-		echo " " >> $dir/cluster_info
-		echo "MASTER: "  >> $dir/cluster_info
-		cat /debug/dlm/clvmd_master >> $dir/cluster_info
+		cat /debug/dlm/clvmd
+		echo
+		echo "WAITERS:"
+		cat /debug/dlm/clvmd_waiters
+		echo
+		echo "MASTER:"
+		cat /debug/dlm/clvmd_master
 	fi
+	} > $dir/cluster_info
 fi
 
 myecho "Gathering LVM & device-mapper version info..."



             reply	other threads:[~2007-08-20 12:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-20 12:06 meyering [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-04-19 13:47 LVM2/scripts lvm_dump.sh agk
2012-04-19 13:47 agk
2007-10-03 15:00 mornfall
2007-04-19 23:06 bmr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070820120636.29293.qmail@sourceware.org \
    --to=meyering@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.