How to capture console messages during boot?

Ian Smith smithi at nimnet.asn.au
Wed Jan 25 13:14:07 UTC 2017


In freebsd-questions Digest, Vol 660, Issue 3 Message: 19
On Tue, 24 Jan 2017 21:17:02 -0800 David Christensen <dpchrist at holgerdanske.com> wrote:
 > > On Tue, 24 Jan 2017 19:59:01 -0800
 > > David Christensen <dpchrist at 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


More information about the freebsd-questions mailing list