Subject: Re: save old dmesg outputs
To: Jeremy C. Reed <reed@reedmedia.net>
From: Mike M. Volokhov <mishka@netbsd.org>
List: tech-userlevel
Date: 07/30/2006 10:12:22
"Jeremy C. Reed" <reed@reedmedia.net> wrote:
> > "Jeremy C. Reed" <reed@reedmedia.net> writes:
> 
> > 
> > > Any thoughts on this?
> > 
> > Isn't the dmesg already getting syslog'd to /var/log/messages?
> 
> Yes.
> 
> My email containing quoted part above said:
> 
>   "I know that /var/log/messages keeps same, but on long running
>   systems, by default, you will lose your old dmesg output."
> 


[I'm sorry for not reading very first messages]

Why not save just all boot messages, including dmesg and rcd output?
I've proposed some solution in bin/27393. It introduces new function
rclog() in the rc.subr library, and output of just any command executed
will going into /var/log/{boot,shutdown}.log files. It can be modified 
to save dmesg as well.

But talking about dmesg, if it will be saved at boot time only, and
system will be up long enough time, you will have just boot dmesg and very 
recent dmesg, and rest will be missed. So I'm sure you need to setup
syslog for kernel messages properly. For example, you can save them all
into separate file and rotate it once per month, having no more than 12
files of 1m in size each.

--
Mishka.