From owner-freebsd-current@FreeBSD.ORG Wed Apr 8 16:12:18 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 371D0A29 for ; Wed, 8 Apr 2015 16:12:18 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E0C8F64 for ; Wed, 8 Apr 2015 16:12:18 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 08EB6B945; Wed, 8 Apr 2015 12:12:17 -0400 (EDT) From: John Baldwin To: Poul-Henning Kamp Subject: Re: Early use of log() does not end up in kernel msg buffer Date: Mon, 06 Apr 2015 17:46:57 -0400 Message-ID: <16486425.yXJbENQqeC@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <70135.1428354681@critter.freebsd.dk> References: <5514CC6D.3020607@badgerio.us> <2033248.Eu3RHS8lTG@ralph.baldwin.cx> <70135.1428354681@critter.freebsd.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 08 Apr 2015 12:12:17 -0400 (EDT) Cc: Eric Badger , freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2015 16:12:18 -0000 On Monday, April 06, 2015 09:11:21 PM Poul-Henning Kamp wrote: > -------- > In message <2033248.Eu3RHS8lTG@ralph.baldwin.cx>, John Baldwin writes: > > >I think phk@ 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@ (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