Re: How much survives an install/reboot cycle?

From: Warner Losh <imp_at_bsdimp.com>
Date: Sun, 19 Nov 2023 18:17:49 UTC
On Sun, Nov 19, 2023 at 8:51 AM bob prohaska <fbsd@www.zefox.net> wrote:

> How much of a running system's state survives a reboot? I used to think
> the answer was "nothing", but from time to time a second reboot behaves
> a  little differently from the previous one.
>
> The most recent example was an update to bpf.c: Prior to the update an
> armv7 system had been inclined to drop ssh connections left up for days.
> After updating and running a build/install cycle the behavior persisted,
> but since a second reboot with no intentional changes it has stopped.
>
> I've not tampered with nextboot, so I don't think that's it. Maybe I'm
> just imagining imagining things....
>

Generally, nothing survives reboot. Nothing in RAM that is. Everything
on disk should survie. swap survives boot, but we ignore it unless
there's a core dump in there.  Dirty pages in the buffer cache will be
flushed to disk, unless the reboot is a crash.

And sometimes, RAM will survive a reboot. It all depends on what the BIOS
does. I've had dmesg survie several reboots because the kernel was the same
and the msgbuf wound up in the same place and we recovered (And appended to)
that (though saying that now, I'm not sure how FreeBSD does that). Some
machines
don't destructively memory test all RAM and/or clear RAM on a warm reboot.

ssh dropping connections, though, may be a feature of ssh. Check that the
following options haven't change and/or aren't causing you problems:
ServerAliveCountMax, ServerAliveInterval, or TCPKeepAlive (for the client)
and
ChanelTimeout, UnusedConnectionTimeout, ClientAliveCountMax,
ClientAliveInterval,
or TCPKeepAlive (for the server). I hit this with ForwardX11Timeout which
I had set to 99999w but now have to set it to 999w since sshd rejected such
a long time. The default values of these change at random (at least
seemingly
so for people like me that can't be bothered to read the release notes).
I'm not
completely sure this is your problem, but if it is weird, it may be.

Warner