aboutsummaryrefslogtreecommitdiff
path: root/rc.single
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2011-04-01 15:42:26 +0200
committerTom Gundersen <teg@jklm.no>2011-04-23 21:43:31 +0200
commita5bdefd41f8ce9ec1be567fcdf8eea20f39fda48 (patch)
treed461c22521cfeee48e43a1399fb0bb9fe1f027db /rc.single
parent09c27ea248efebe1e72aa688cb55996dadbbbe29 (diff)
downloadinitscripts-a5bdefd41f8ce9ec1be567fcdf8eea20f39fda48.tar.xz
bootlogd: log messages to console during early boot
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 <nikorpoulsen@gmail.com> Tested-by: David Goldstein <djg1971@gmail.com> Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.single')
-rwxr-xr-xrc.single4
1 files changed, 4 insertions, 0 deletions
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: