Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Nov 2022 10:37:14 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Mike Karels <mike@karels.net>
Cc:        Dan Mack <mack@macktronics.com>, freebsd-current@freebsd.org
Subject:   Re: dmesg content lifetime
Message-ID:  <CANCZdfqCtjVER5Tsr__Pfkgy=ay_0we2NrjgVEn4ddQmSzfW8A@mail.gmail.com>
In-Reply-To: <21FB93B6-708F-4E69-B482-C7601C15394A@karels.net>
References:  <9d519f-ce87-72d-dc6-789817468974@macktronics.com> <CANCZdfq9Q%2BpRBo1HvTDgHcQ6ytMA%2BzZ0DqVx_2E=GoZuBOqWdQ@mail.gmail.com> <6146841c-baef-134-dcd9-30db2d92732@macktronics.com> <21FB93B6-708F-4E69-B482-C7601C15394A@karels.net>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Tue, Nov 22, 2022 at 8:49 AM Mike Karels <mike@karels.net> wrote:

> On 22 Nov 2022, at 9:34, Dan Mack wrote:
>
> > It disappears a piece at a time - the oldest entries disappear first.
> However, it vanishes even when there are only 2-3 lines in it so I didn't
> think capacity was in play as I expected.
> >
> > So for example I might see a rate-limit entry from someone spamming the
> system and then it will usually be gone in a couple days and the buffer is
> completely empty.   Similarly if I do something like ifconfig em0 down;
> ifconfig em0 up ; it's logged but disappears after a day or so.
> >
> > I'm looking to see if this is just a cron job or something clearing it
> as it might be user-error on my part.   Also this is an older system so
> I'll probably look at it again after I update.
>
> I noticed this too, but discovered with “dmesg -a” that the buffer was full
> of syslog messages, so dmesg without -a showed nothing.
>
> It seems unfortunate that syslog messages logged in the message buffer, at
> least once syslogd is running.  Apparently this happens because they are
> output to /dev/console.
>

Output to /dev/console that's not via syslogd goes into this buffer for
syslogd
to harvest and put in log files. IIRC, though, there's also the messages
that
syslogd sends to /dev/console in this buffer as well, which can be
confusing.
I'm not sure what a saner policy would be given both of these use cases.

Warner

                Mike
>
> > Thank you,
> >
> > Dan
> >
> >
> > On Tue, 22 Nov 2022, Warner Losh wrote:
> >
> >> On Tue, Nov 22, 2022 at 8:13 AM Dan Mack <mack@macktronics.com> wrote:
> >>
> >>> It seems like dmesg content ages out over time.   Is there a way to
> leave
> >>> the contents based on a fixed memory size instead?
> >>>
> >>
> >> It already is a fixed memory size. Do you see it all disappear at once,
> or
> >> over time?
> >>
> >> Warner
> >>
>

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 22, 2022 at 8:49 AM Mike Karels &lt;<a href="mailto:mike@karels.net" target="_blank">mike@karels.net</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 22 Nov 2022, at 9:34, Dan Mack wrote:<br>
<br>
&gt; It disappears a piece at a time - the oldest entries disappear first. However, it vanishes even when there are only 2-3 lines in it so I didn&#39;t think capacity was in play as I expected.<br>
&gt;<br>
&gt; So for example I might see a rate-limit entry from someone spamming the system and then it will usually be gone in a couple days and the buffer is completely empty.   Similarly if I do something like ifconfig em0 down; ifconfig em0 up ; it&#39;s logged but disappears after a day or so.<br>
&gt;<br>
&gt; I&#39;m looking to see if this is just a cron job or something clearing it as it might be user-error on my part.   Also this is an older system so I&#39;ll probably look at it again after I update.<br>
<br>
I noticed this too, but discovered with “dmesg -a” that the buffer was full<br>
of syslog messages, so dmesg without -a showed nothing.<br>
<br>
It seems unfortunate that syslog messages logged in the message buffer, at<br>
least once syslogd is running.  Apparently this happens because they are<br>
output to /dev/console.<br></blockquote><div><br></div><div>Output to /dev/console that&#39;s not via syslogd goes into this buffer for syslogd</div><div>to harvest and put in log files. IIRC, though, there&#39;s also the messages that</div><div>syslogd sends to /dev/console in this buffer as well, which can be confusing.</div><div>I&#39;m not sure what a saner policy would be given both of these use cases.</div><div><br></div><div>Warner</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                Mike<br>
<br>
&gt; Thank you,<br>
&gt;<br>
&gt; Dan<br>
&gt;<br>
&gt;<br>
&gt; On Tue, 22 Nov 2022, Warner Losh wrote:<br>
&gt;<br>
&gt;&gt; On Tue, Nov 22, 2022 at 8:13 AM Dan Mack &lt;<a href="mailto:mack@macktronics.com" target="_blank">mack@macktronics.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; It seems like dmesg content ages out over time.   Is there a way to leave<br>
&gt;&gt;&gt; the contents based on a fixed memory size instead?<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; It already is a fixed memory size. Do you see it all disappear at once, or<br>
&gt;&gt; over time?<br>
&gt;&gt;<br>
&gt;&gt; Warner<br>
&gt;&gt;<br>
</blockquote></div></div>
</div>

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