Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jan 2017 00:13:55 +1100 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        David Christensen <dpchrist@holgerdanske.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to capture console messages during boot?
Message-ID:  <20170125230947.T59687@sola.nimnet.asn.au>
In-Reply-To: <mailman.109.1485345602.88614.freebsd-questions@freebsd.org>
References:  <mailman.109.1485345602.88614.freebsd-questions@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In freebsd-questions Digest, Vol 660, Issue 3 Message: 19
On Tue, 24 Jan 2017 21:17:02 -0800 David Christensen <dpchrist@holgerdanske.com> wrote:
 > > On Tue, 24 Jan 2017 19:59:01 -0800
 > > David Christensen <dpchrist@holgerdanske.com> wrote:
 > >> I am attempting to build a graphical workstation using:
 > >> [snip]
 > >> As I add software and adjust configuration settings, invariably I create
 > >> or encounter issues.  Some of these generate warnings/ errors on the
 > >> console when the system boots.  I'd like to capture console messages
 > >> during boot, so that I can review them and fix things.

The old-fashioned way is to add to /etc/syslog.conf 

# uncomment this to log all writes to /dev/console to /var/log/console.log
# touch /var/log/console.log and chmod it to mode 600 before it will work
console.info		/var/log/console.log

and in /etc/newsyslog.conf perhaps (mode 640 so :wheel can read)
/var/log/console.log			640   7   200   *   J

&& service syslogd restart

 > On 01/24/17 20:45, Sergei Akhmatdinov wrote:
 > > 2. Use `dmesg -a`, maybe piped into `less` if you prefer.
 > >    The -a switch should show you the boot process messages, which are normally
 > >    suppressed.
 > 
 > Yes, that's what I was looking for.

That includes what's in both /var/log/messages and /var/log/consoie.log

 > On 01/24/17 21:07, Michael Sierchio wrote:
 >  > cat /var/run/dmesg.boot
 > 
 > That is incomplete -- I don't see all of the messages (just kernel, not 
 > init?).

If you choose verbose boot, or have added boot_verbose="YES" to 
/boot/loader.conf you'll get much more detailed messages (and dmesg) 
from boot and afterwards, but usually the same console.log - which is 
just what you'd see on the root console, if you were always looking :)

cheers, Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170125230947.T59687>