NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/41946: rc.d should honour AB_SILENT

The following reply was made to PR bin/41946; it has been noted by GNATS.

From: Alan Barrett <>
Subject: Re: bin/41946: rc.d should honour AB_SILENT
Date: Mon, 31 Aug 2009 08:59:44 +0200

 On Thu, 27 Aug 2009, wrote:
 >      Capture all messages to a log file in /var, and make rc.d twiddle
 >      like the kernel does when booting with AB_SILENT. If any output on
 >      stderr is captured, report that at least one system service reported
 >      an error at startup and to reference the log file for more information.
 I am working on this.  My plan is:
   1) expose the kernel's boothowto variable through sysctl kern.boothowto
   2) teach rc.subr to parse the sysctl output to set several shell
      variables to record which bits are on or off (done);
   3) add a twiddle function to rc.subr (done);
   4) make rc and/or rc.subr DTRT for the remainder of the problem
      (in progress).
 The last step is tricky because there may be no writable file
 systems early in the boot, both /var/run and /tmp may be erased by
 rc.d scripts during the boot, and /usr/bin/tee is not available
 early in the boot.  Also, I can't easily keep stdout and stderr
 separate, so I am using the script's exit status (not the presence
 or absence of output on stderr) to detect errors.  I have it mostly
 working for the AB_SILENT case, but not for the non-silent case
 (which needs tee-like functionality).
 Here's the tail end of my current /var/run/rc.log:
     make: cannot open /usr/pkg/share/autoswc/
     The following scripts returned error status:
        /etc/rc.d/mountcritremote /etc/rc.d/chronyd /etc/rc.d/bacula-sd
     /etc/rc finished at Mon Aug 31 06:21:56 UTC 2009
 The things in square brackets appear only in the log file.  The
 normal text appears on the console as well as in the log file in
 normal mode, but in silent mode the console gets a twiddle instead
 of the normal text.  The error summary at the end appears on the
 console even in silent mode.
 --apb (Alan Barrett)

Home | Main Index | Thread Index | Old Index