BootLogd

Differences between revisions 1 and 22 (spanning 21 versions)
Revision 1 as of 2005-04-23 03:13:53
Size: 1129
Editor: CPE-60-225-13-161
Comment: create
Revision 22 as of 2005-04-27 06:30:51
Size: 6937
Editor: intern146
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from UbuntuDevel/BootLogd
Line 9: Line 10:
  * People: NeedsLead, NeedsSecond[[BR]]   * People: AndresSalomonLead, HerbertXuSecond, AndresSalomonQueue[[BR]]
Line 11: Line 12:
  * Interested: [[BR]]
  * Status: BrainDump, BreezyGoal, UduBof, DistroSpecification[[BR]]
  * Interested: OliverGrawert, JeffBailey [[BR]]
  * Status: DraftSpec, BreezyGoal, UduBof, DistroSpecification[[BR]]
Line 25: Line 26:
Much useful information is discarded, especially due to early gdm startup, and later UbuntuDevel/USplash. A lot of useful information is discarded, especially due to early gdm startup, and later ["USplash"].  This becomes an even larger problem as things are moved earlier and earlier into the boot process.
Line 29: Line 30:
  * Debugging user problems early in the boot process (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. As well, init script output should be directed to `/dev/null`, or some other tty, so that the user doesn't see it.
  * Enable remote logging of problems on servers, for cases where the disk is not writable.
Line 30: Line 35:

  * Enable bootlogd immediately; this simply requires changing '/etc/default/bootlogd'. Fix immediate bugs (at least on Debian and Hoary, it seems to log correctly).
  * Modify bootlogd to create a socket/pipe/pty device in /dev (ie, /dev/bootlogd). Anything written to this device will get written to the log file (/var/log/boot).
  * Modify init scripts to (if VERBOSE=no in /etc/default/rcS) redirect output to /dev/bootlogd instead of /dev/null. This ensures that the user only sees "pretty" output on console, but verbose output ends up in /var/log/boot.
  * Possible enhancements:
    * Move initramfs startup to even earlier in the boot process (perhaps from initrd or initramfs). Currently, bootlogd will store output in a ring buffer, and dump to file once the file is writable. Ensure that this ring buffer is large enough for the extra output added by bootlogd starting earlier. As things are moved into initramfs (ie, hotplug), this becomes more important.
    * Log to syslog instead of writing directly to file. This allows for more flexibilty, as we can log remotely.
   
  * Currently, output between the kernel starting init and when bootlogd is started is lost. Move startup of bootlogd to as early as possible (possibly even to initramfs). Modify bootlogd to store output in ring buffer, and do not write to file
  * 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. The bootlogd author does not recommend using the daemon. Pros: quick and easy. Cons: inflexible, fragile.

  * Or, create a custom solution. Possibilities include:
      * log to `/dev/log` (syslog). For init scripts, either the lsb-init functions can handle std{err,out}, or rcS can be modified to redirect those when running init scripts.
      * prior to syslog being available, have a daemon started from init that logs all console output into a ring buffer, and then spits it all out once the network becomes available, or disk becomes writable (to `/dev/log`). Console logging can either just scrape the kernel's ring buffer (ie, klogd), and/or force init to log its childrens output (a patch from Red Hat is available for this).
Line 33: Line 52:
  N/A
Line 35: Line 56:
 * `sysvinit`
 * `lsb-init`
 * `initscripts`
 
Line 37: Line 62:
["USplash"] requirements need to be taken into consideration; if it is using the non-verbose output from init scripts, this needs to be made available in a simple fashion. Non-USplash users should not see verbose output on their console, but it should be logged to a file.
Line 38: Line 65:

The bootlogd author considers bootlogd experimental, and not suitable for end users.
Do we settle for `bootlogd`, or do we create something custom? Suse and Redhat both have patches floating around to modify `init` to log console to different places.
Line 43: Line 73:
 * How early should it be enabled? One of the suggestions ([http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=272428 #272428]) included starting bootlogd from initrd, so that everything gets logged.
Line 46: Line 77:
 * Research the problems which resulted in Debian when enabling bootlogd the last time (udev related?)  * 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:
   * [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=205724 #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...
   * [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=237056 #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.
   * [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=213028 #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.

 * Suggestions by the author:
   * 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.
 Other possibilities:
   * 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.

UbuntuDevel/BootLogd

Status

Introduction

Preserve output from the system initialization process.

Rationale

A lot of useful information is discarded, especially due to early gdm startup, and later ["USplash"]. This becomes an even larger problem as things are moved earlier and earlier into the boot process.

Scope and Use Cases

  • Debugging user problems early in the boot process (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. As well, init script output should be directed to /dev/null, or some other tty, so that the user doesn't see it.

  • Enable remote logging of problems on servers, for cases where the disk is not writable.

Implementation Plan

  • Enable bootlogd immediately; this simply requires changing '/etc/default/bootlogd'. Fix immediate bugs (at least on Debian and Hoary, it seems to log correctly).
  • Modify bootlogd to create a socket/pipe/pty device in /dev (ie, /dev/bootlogd). Anything written to this device will get written to the log file (/var/log/boot).
  • Modify init scripts to (if VERBOSE=no in /etc/default/rcS) redirect output to /dev/bootlogd instead of /dev/null. This ensures that the user only sees "pretty" output on console, but verbose output ends up in /var/log/boot.
  • Possible enhancements:
    • Move initramfs startup to even earlier in the boot process (perhaps from initrd or initramfs). Currently, bootlogd will store output in a ring buffer, and dump to file once the file is writable. Ensure that this ring buffer is large enough for the extra output added by bootlogd starting earlier. As things are moved into initramfs (ie, hotplug), this becomes more important.
    • Log to syslog instead of writing directly to file. This allows for more flexibilty, as we can log remotely.
  • Currently, output between the kernel starting init and when bootlogd is started is lost. Move startup of bootlogd to as early as possible (possibly even to initramfs). Modify bootlogd to store output in ring buffer, and do not write to file
  • 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. The bootlogd author does not recommend using the daemon. Pros: quick and easy. Cons: inflexible, fragile.

  • Or, create a custom solution. Possibilities include:
    • log to /dev/log (syslog). For init scripts, either the lsb-init functions can handle std{err,out}, or rcS can be modified to redirect those when running init scripts.

    • prior to syslog being available, have a daemon started from init that logs all console output into a ring buffer, and then spits it all out once the network becomes available, or disk becomes writable (to /dev/log). Console logging can either just scrape the kernel's ring buffer (ie, klogd), and/or force init to log its childrens output (a patch from Red Hat is available for this).

Data Preservation and Migration

  • N/A

Packages Affected

  • sysvinit

  • lsb-init

  • initscripts

User Interface Requirements

["USplash"] requirements need to be taken into consideration; if it is using the non-verbose output from init scripts, this needs to be made available in a simple fashion. Non-USplash users should not see verbose output on their console, but it should be logged to a file.

Outstanding Issues

The bootlogd author considers bootlogd experimental, and not suitable for end users. Do we settle for bootlogd, or do we create something custom? Suse and Redhat both have patches floating around to modify init to log console to different places.

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 ([http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=272428 #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:
    • [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=205724 #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...

    • [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=237056 #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.

    • [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=213028 #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.
  • Suggestions by the author:
    • 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.

    Other possibilities:
    • 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.

UbuntuDownUnder/BOFs/BootLogd (last edited 2010-03-31 07:46:27 by pool-71-173-140-218)