public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/scripts lvm_dump.sh
@ 2007-08-20 12:06 meyering
  0 siblings, 0 replies; 5+ messages in thread
From: meyering @ 2007-08-20 12:06 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	meyering@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..."


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2/scripts lvm_dump.sh
@ 2012-04-19 13:47 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2012-04-19 13:47 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2012-04-19 13:47:38

Removed files:
	scripts        : lvm_dump.sh 

Log message:
	.

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


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2/scripts lvm_dump.sh
@ 2012-04-19 13:47 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2012-04-19 13:47 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2012-04-19 13:47:11

Added files:
	scripts        : lvm_dump.sh 

Log message:
	.

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

/cvs/lvm2/LVM2/scripts/lvm_dump.sh,v  -->  standard output
revision 1.1


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2/scripts lvm_dump.sh
@ 2007-10-03 15:01 mornfall
  0 siblings, 0 replies; 5+ messages in thread
From: mornfall @ 2007-10-03 15:01 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2007-10-03 15:00:52

Modified files:
	scripts        : lvm_dump.sh 

Log message:
	a) use dmsetup version to check for dmsetup, but if it fails, set
	DMSETUP=: to disable dmsetup checks (but let the script run
	nevertheless); warn the user if this is the case
	b) put the non-root and dmsetup warnings both at start and end of
	output

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

--- LVM2/scripts/lvm_dump.sh	2007/10/02 16:09:46	1.11
+++ LVM2/scripts/lvm_dump.sh	2007/10/03 15:00:51	1.12
@@ -44,7 +44,7 @@
 }
 
 "$LVM" version >& /dev/null || die 2 "Could not run lvm binary '$LVM'"
-"$DMSETUP" help >& /dev/null || die 2 "Fatal: could not run dmsetup binary '$DMSETUP'"
+"$DMSETUP" version >& /dev/null || DMSETUP=:
 
 function usage {
 	echo "$0 [options]"
@@ -99,7 +99,16 @@
 	eval "$@"
 }
 
-echo " "
+warnings() {
+	if test "$UID" != "0" && test "$EUID" != "0"; then
+		myecho "WARNING! Running as non-privileged user, dump is likely incomplete!"
+	elif test "$DMSETUP" = ":"; then
+		myecho "WARNING! Could not run dmsetup, dump is likely incomplete."
+	fi
+}
+
+warnings
+
 myecho "Creating dump directory: $dir"
 echo " "
 
@@ -211,16 +220,15 @@
 if test -z "$userdir"; then
 	lvm_dump="$dirbase.tgz"
 	myecho "Creating report tarball in $HOME/$lvm_dump..."
+fi
+
+warnings
+
+if test -z "$userdir"; then
 	cd "$HOME"
 	"$TAR" czf "$lvm_dump" "$dirbase" 2>/dev/null
 	"$RM" -rf "$dir"
 fi
 
-if test "$UID" != "0" && test "$EUID" != "0"; then
-	myecho
-	myecho "WARNING! Running as non-privileged user, dump is likely incomplete!"
-	myecho
-fi
-
 exit 0
 


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2/scripts lvm_dump.sh
@ 2007-04-19 23:06 bmr
  0 siblings, 0 replies; 5+ messages in thread
From: bmr @ 2007-04-19 23:06 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	bmr@sourceware.org	2007-04-20 00:06:05

Modified files:
	scripts        : lvm_dump.sh 

Log message:
	re-commit lvm_dump.sh change

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

--- LVM2/scripts/lvm_dump.sh	2006/11/23 17:23:14	1.3
+++ LVM2/scripts/lvm_dump.sh	2007/04/19 23:06:05	1.4
@@ -147,7 +147,7 @@
 log "$CP -a /etc/lvm $dir/lvm 2>> $log"
 
 myecho "Gathering /dev listing..."
-log "$LS -la /dev > $dir/dev_listing 2>> $log"
+log "$LS -laR /dev > $dir/dev_listing 2>> $log"
 
 if (( $metadata )); then
 	myecho "Gathering LVM metadata from Physical Volumes..."


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

end of thread, other threads:[~2012-04-19 13:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-20 12:06 LVM2/scripts lvm_dump.sh meyering
  -- strict thread matches above, loose matches on Subject: below --
2012-04-19 13:47 agk
2012-04-19 13:47 agk
2007-10-03 15:01 mornfall
2007-04-19 23:06 bmr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).