Re: Early use of log() does not end up in kernel msg buffer

From: John Baldwin <jhb_at_freebsd.org>
Date: Mon, 06 Apr 2015 17:46:57 -0400
On Monday, April 06, 2015 09:11:21 PM Poul-Henning Kamp wrote:
> --------
> In message <2033248.Eu3RHS8lTG_at_ralph.baldwin.cx>, John Baldwin writes:
> 
> >I think phk_at_ broke this back in 70239.  Before that the log() function did
> >this:
> >
> >log()
> >{
> >
> >	/* log to the msg buffer */
> >	kvprintf(fmt, msglogchar, ...);
> >
> >	if (!log_open) {
> >		/* log to console */
> >		kvprintf(fmt, putchar, ...);
> >	}
> >}
> >
> >I think your patch is fine unless phk_at_ (cc'd) has a reason for not wanting to
> >do this.
> 
> The reason was systems not running syslog having slow serial consoles.

To be clear, you didn't turn off printing to the console, you turned off
writing to the msglog.

That is, before your change:

- If syslog wasn't running, the message was sent to the msglog (so that a
  subsequently started syslog would see it) and to the console.
- If syslog was running, the message was only sent to the msglog, but not
  the console.

After your change:

- If syslog isn't running, the message is only sent to the console.
- If syslog is running, the message is only sent to the msglog.

The direct result is that less data is sent to the msglog.  Is the concern
that when syslogd starts up any pre-boot log messages can be sent over the
console a second time by the syslogd process writing to /dev/console?

Note that this does mean that any messages logged before syslogd are lost
and cannot be accessed by any software on the box that wants to do parse
syslogd output, etc. (which is what is probably causing problems for the
OP).

-- 
John Baldwin
Received on Wed Apr 08 2015 - 14:12:18 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:56 UTC