BootLogd
UbuntuDevel/BootLogd
Status
Created: Date(2005-04-23T03:13:53Z) by MattZimmermanBR
Priority: LowPriorityBR
People: AndresSalomonLead, HerbertXuSecondBR
Contributors: MattZimmermanBR
Interested: OliverGrawert BR
Status: BrainDump, BreezyGoal, UduBof, DistroSpecificationBR
Branch: BR
Malone Bug: BR
Packages: BR
Depends: BR
UduSessions: 1
Introduction
Preserve output from the system initialization process.
Rationale
Much useful information is discarded, especially due to early gdm startup, and later UbuntuDevel/USplash. We have the option of fixing up bootlogd to do what we need, or going with another solution.
Scope and Use Cases
- Debugging user problems early in the boot process (kernel or init script related). Logging everything to a file will go a long way towards tracing problems.
- USplash wants a way to grab status information and output from init scripts, and displaying a subset of it.
- Enable remote logging of problems on servers, for cases where the disk is not writable.
Implementation Plan
- Use bootlogd; enabling it should be as simple as changing /etc/default/bootlogd. The udev problem should be fixed, any other bugs that come up can be fixed. Something for USplash can be hacked together (perhaps still capturing init script output via lsb-init functions) when necessary.
- Or, hack init to do the following:
- - prior to /var/log being writable, save kernel messages to buffer (or scrape kernel ring buffer once disk is writable), and dump once disks becomes writable. For
- Fix bugs that arise, and hack something together for USplash (perhaps still capturing the init script output via lsb-init). OR
Data Preservation and Migration
- N/A
Packages Affected
- sysvinit, lsb-init, initscripts
User Interface Requirements
Outstanding Issues
- Do we
UDU BOF Agenda
- What needs to be done in order to enable bootlogd?
- Enable it and start fixing the bugs
- How early should it be enabled? One of the suggestions (#272428) included starting bootlogd from initrd, so that everything gets logged.
UDU Pre-Work
- Bootlogd is started (in debian) from S05 (after udev, mountvirtfs, and mdadm), and logs to /var/log/boot. The
(sysvinit) author considers it broken/experimental, and has disabled it by default.
- Known problems include:
- #205724: Since it runs before fsck, it logs all spinner changes. This causes huge logfiles, and slows down
- fsck considerably since it fsyncs after every line/write. Joeyh proposed only writing upon newlines...
- #237056: udev was not providing /dev/ttyzf, which bootlogd needs. This appears to no longer be the case; at
- least w/ debian's udev_056-2 + 2.6.11, as well a hoary's udev (w/ 2.6.10), /dev/ttyzf is created.
- #213028: bootlogd needs to not run while in single user mode, otherwise things like passwords, fsck, and
- lots of unnecessary stuff end up getting logged to a world-writable log file.
- direct logging of console requires a) figuring out what the console actually is (parsing kernel arg console=,
- etc; pre-2.4, there was an ioctl to get w/ this, TIOCGDEV), and b) logging terminal control characters.
- Add more support in kernel for bootlogd; author didn't expand upon that.
- Provide wrapper for starting init scripts, that logs all output to /dev/bootlogd. Bootlogd listens on this
- socket, stores logging info in ring buffer, and dumps to /var once it's writable.
- When starting init scripts from /etc/init.d/rc{,S}, log all output to socket and console. Bootlogd then
- reads logs from socket instead of /dev/console. Or, skip bootlogd stuff and write to /dev/log once sysklogd has been started, so that syslog.conf can control logging.
- Start bootlogd from initrd; store logs in ring buffer until /var/log is writable, at which point dump early
- logs to disk, fsync, and begin normal logging.
- #205724: Since it runs before fsck, it logs all spinner changes. This causes huge logfiles, and slows down