How to get in a file all boot messages to console?

/var/run/dmesg.boot contains the kernel messages, the white ones, not the gray ones (uaserland).
/var/log/messages catch the same ones.
I want to also have the gray ones in the file, a copy of the boot messages until login prompt.

Any hint?

The reason, if one wants to know: I want to boot a client with pxe, and since I do not have the console,
I want at least to be able to see the messages after the boot.

The client does not have a com cable, not even a the pins for a speaker to signal the end of BIOS probes.
Miserable de luxe ASUS motherboard,
 
Oct 14 21:55:28 z kernel: Starting file system checks:
Oct 14 21:55:28 z kernel: Starting Network: lo0 vtnet0.
Oct 14 21:55:28 z kernel: Starting devd.
Oct 14 21:55:28 z kernel: Starting syslogd.
Oct 14 21:55:28 z kernel: Starting snmpd.
Oct 14 21:55:28 z kernel: Starting saslauthd.
Oct 14 21:55:28 z kernel: Starting milteropendkim.
Oct 14 21:55:30 z kernel: Starting cron.
Oct 14 21:55:30 z kernel: Starting sshd.
Oct 14 21:55:30 z kernel: Starting dovecot.
Oct 14 21:55:30 z kernel: Starting mysql.
Oct 14 21:55:33 z kernel: Starting sphinxsearch.
Oct 14 21:55:33 z kernel: Starting background file system checks in 60 seconds.
Oct 14 21:55:33 z kernel: Starting sendmail.
Oct 14 21:55:33 z kernel: Starting sendmail_msp_queue.
Oct 14 21:55:34 z kernel: Starting apache24.
 
Run systemd.

Cough.

Seriously, the only ways are:

1) wrapping individual rc scripts in () 2>&1 | tee /var/run/boot.foo.lof

2) serial console
 
console.info works for me
Oct 14 21:54:51 z kernel: Oct 14 21:54:51 z reboot[2528]: rebooted by titus
Oct 14 21:55:28 z kernel: Oct 14 21:54:51 z syslogd: exiting on signal 15
Oct 14 21:55:28 z kernel: Setting hostuuid: 2336ead0-f79a-4495-9db9-48b6cefd01b8.
Oct 14 21:55:28 z kernel: Setting hostid: 0xd4d0c77d.
Oct 14 21:55:28 z kernel: cannot import 'panzer': no such pool or dataset
Oct 14 21:55:28 z kernel: Destroy and re-create the pool from
Oct 14 21:55:28 z kernel: a backup source.
Oct 14 21:55:28 z kernel: cachefile import failed, retrying
Oct 14 21:55:28 z kernel: no pools available to import
Oct 14 21:55:28 z kernel: Starting file system checks:
Oct 14 21:55:28 z kernel: Mounting local filesystems:.
Oct 14 21:55:28 z kernel: Autoloading module: intpm
Oct 14 21:55:28 z kernel: Autoloading module: virtio_console
Oct 14 21:55:28 z kernel: /etc/rc: WARNING: $exampl_enable is not set properly - see rc.conf(5).
Oct 14 21:55:28 z kernel: Setting hostname: z.CENSORED.DOM
Oct 14 21:55:28 z kernel: Setting up harvesting: PURE_RDRAND,[CALLOUT],[UMA],[FS_ATIME],SWI,INTERRUP
Oct 14 21:55:28 z kernel: Feeding entropy: .
Oct 14 21:55:28 z kernel: ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local
Oct 14 21:55:28 z kernel: 32-bit compatibility ldconfig path: /usr/lib32
Oct 14 21:55:28 z kernel: Starting Network: lo0 vtnet0.
Oct 14 21:55:28 z kernel: lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16
Oct 14 21:55:28 z kernel: options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
Oct 14 21:55:28 z kernel: inet 127.0.0.1 netmask 0xff000000
Oct 14 21:55:28 z kernel: inet6 ::1 prefixlen 128
Oct 14 21:55:28 z kernel: inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
Oct 14 21:55:28 z kernel: groups: lo
Oct 14 21:55:28 z kernel: nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
Oct 14 21:55:28 z kernel: vtnet0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> met
Oct 14 21:55:28 z kernel: options=ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_
 
Seriously, the only ways are:
Believe it or not, covacat is right!!!

console.log gives the user land messages, the kernel messages are /var/run/dmesg.boot

But now I have a different problem.

Since lockd is starts after devd and syslogd, I get the errors:

devd: cannot open pid file:operation not supported
syslogd: cannot open pid file: operation not supported
To solve it, I added to rc.conf (quite exagerated for perhaps a harmless error):

diskless_mount="/etc/rc.initdiskless"
varmfs="YES"
varsize="32m" # size of RAM-Disk for /var (adapt)

Since I have now a volatile /var, I cannot get /var/log/console.log with 600 permissions at boot time.

I put console.log in /root, but I do not want that these messages accumulate, I want a new file at every boot.

I do not want to do too much changes in rc, any idea?
 
set a C flag for console.log in newsyslog.conf or set newsyslog_flags as -CCN

Thanks! I never used that, but seems to be the solution.

I put in the meantime truncate -s 0 /root/console.log at the end of /etc/rc.shutdown,
but that seems to be not a good idea.

The idea of keeping file pro session is the readability. After a boot I want to check that it booted ok.
Perhaps to have also the last shutdown messages is OK.
 
Back
Top