Patchwork [3/3] run-postinsts: add more logging to the log file to make things clearer

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date July 19, 2013, 9:39 a.m.
Message ID <6c88ed5994aec47f5882e3a410f0884a37939e6b.1374226651.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/54057/
State Accepted
Commit aa7bc3caca1fbdc2f452f1d9871bb40847fb04d7
Headers show

Comments

Qi.Chen@windriver.com - July 19, 2013, 9:39 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

When all postinsts scripts succeed at system startup, it's very possible
that the log file /var/log/postinstall.log is empty. This is kind of
confusing, as that file is supposed to hold information about the postinsts.

Add more logging to the log file to make things clearer.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../run-postinsts/run-postinsts/run-postinsts      |    2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
index 2a8d1d6..c94c3e9 100755
--- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -24,6 +24,7 @@  remove_pi_dir=1
 for i in `ls $pi_dir`; do
 	i=$pi_dir/$i
 	echo "Running postinst $i..."
+	[ "$POSTINST_LOGGING" = "1" ] && echo "Running postinst $i..." >> $LOGFILE
 	if [ -x $i ]; then
 		if [ "$POSTINST_LOGGING" = "1" ]; then
 			sh -c $i >>$LOGFILE 2>&1
@@ -33,6 +34,7 @@  for i in `ls $pi_dir`; do
 		rm $i
 	else
 		echo "ERROR: postinst $i failed."
+		[ "$POSTINST_LOGGING" = "1" ] && echo "ERROR: postinst $i failed." >> $LOGFILE
 		remove_pi_dir=0
 	fi
 done