xrmx / bootchart

merge of bootchart-collector and pybootchartgui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bootchartd fails to create bootchart.tgz when run from command line because it expects dmesg log

hyei opened this issue · comments

When running bootchartd from the command line, and then stopping bootchartd, tar fails to find the dmesg log because it is not being dumped when bootchartd is being run as a non-init process. The bootchart.tgz archive is not created in this case.

I have created a patch that seems to do the job:

From: Henry Yei hyei@mvista.com
Date: Tue, 15 Mar 2011 18:20:43 -0700
Subject: [PATCH] expect dmesg log only if bootchartd run as init

Source: MontaVista Software, LLC
MR: 43117
Type: Defect Fix
Disposition: Needs submitting to bootchart2

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.

Signed-off-by: Henry Yei hyei@mvista.com

bootchartd.in | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/bootchartd.in b/bootchartd.in
index a16b07d..bf366d5 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
    
  •   # only expect dmesg log 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
    

Applied, thanks. Next time if you can please post a git url to pull or an url where the patch can be downloaded.