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.single | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rc.single') 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: -- cgit v1.2.3