Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > d88c7bb437f1a231687f3169871ec55f > files > 1

bootchart-0.14.0-1.3.git20110630.4.mga3.src.rpm

From c8305d566021b18f02d1479b6697406874adb448 Mon Sep 17 00:00:00 2001
From: Henry Yei <hyei@mvista.com>
Date: Wed, 16 Mar 2011 22:08:17 +0100
Subject: [PATCH] bootchartd: Expect dmesg log only if bootchartd run as init

The bootchartd script attempts to archive the dmesg
log in all cases, however the dmesg log is only dumped
when bootchartd is being run as the init process. This
patch adds conditional logic to only expect the dmesg
log when it is supposed to be generated.
---
 bootchartd.in |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/bootchartd.in b/bootchartd.in
index 6bea753..ebe9d8b 100755
--- a/bootchartd.in
+++ b/bootchartd.in
@@ -123,7 +123,12 @@ stop()
 	fi
 
 	# Archive it all up into the bootchart output
-	tar -zcf "$BOOTLOG_DEST" header dmesg *.log
+	# expect dmesg log only if bootchartd was started as an init process
+	if [ -n "$INIT_PROCESS" ] ; then
+		tar -zcf "$BOOTLOG_DEST" header dmesg *.log
+	else
+		tar -zcf "$BOOTLOG_DEST" header *.log
+	fi
 
 	rm -Rf $tmpdir