From a5bdefd41f8ce9ec1be567fcdf8eea20f39fda48 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Fri, 1 Apr 2011 15:42:26 +0200 Subject: bootlogd: log messages to console during early boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This saves all the output during boot to /var/log/boot, which makes debugging boot problems much simpler. The logfile contains all the control (color) characters from boot, so some post processing is in order before the log can be read in a nice format (e.g. less should be able to show this nicely in raw mode). Start bootlogd as soon as the required /dev/pts is mounted. When boot is finished (either at the end of rc.multi or rc.single) create the required lof file (/var/log/boot) if it does not exist. This causes bootlogd to flush the log to disk. Finally, send SIGTERM to bootlogd and clean up after it. Idea-and-original-patch-by: Søren Poulsen Tested-by: David Goldstein Signed-off-by: Tom Gundersen --- rc.multi | 4 ++++ rc.single | 4 ++++ rc.sysinit | 1 + 3 files changed, 9 insertions(+) diff --git a/rc.multi b/rc.multi index 693223d..d8bf126 100755 --- a/rc.multi +++ b/rc.multi @@ -26,4 +26,8 @@ fi run_hook multi_end +/bin/touch /var/log/boot +kill `/bin/cat /run/bootlogd.pid` +/bin/rm /run/bootlogd.pid + # vim: set ts=2 sw=2 noet: diff --git a/rc.single b/rc.single index aab2b58..b9701d5 100755 --- a/rc.single +++ b/rc.single @@ -54,5 +54,9 @@ if [[ $RUNLEVEL = 1 ]]; then exec /sbin/init -t1 S fi +/bin/touch /var/log/boot +kill `/bin/cat /run/bootlogd.pid` +/bin/rm /run/bootlogd.pid + # End of file # vim: set ts=2 sw=2 noet: diff --git a/rc.sysinit b/rc.sysinit index 02199b3..0dcd76b 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -33,6 +33,7 @@ fi # start up our mini logger until syslog takes over /sbin/minilogd +/sbin/bootlogd -p /run/bootlogd.pid # Set console verbosity for cmdarg in $(< /proc/cmdline); do -- cgit v1.2.3-54-g00ecf