[Testers wanted] /dev/console cleanups

Nate Eldredge neldredge at math.ucsd.edu
Wed Nov 19 23:48:37 PST 2008


On Wed, 19 Nov 2008, Jeremy Chadwick wrote:

> On Thu, Nov 20, 2008 at 05:39:36PM +1100, Peter Jeremy wrote:

>> I hope that never gets committed - it will make debugging kernel
>> problems much harder.  There is already a kern.msgbuf_clear sysctl and
>> maybe people who are concerned about msgbuf leakage need to learn to
>> use it.
>
> And this sysctl is only usable *after* the kernel loads, which means
> you lose all of the messages shown from the time the kernel loads to
> the time the sysctl is set (e.g. hardware detected/configured).  This is
> even less acceptable, IMHO.

But surely you can arrange that the contents are written out to 
/var/log/messages first?

E.g. a sequence like

- mount /var
- write buffer contents via syslogd
- clear buffer via sysctl
- allow user logins

This way the buffer is cleared before any unprivileged users get to do 
anything.  No kernel changes needed, just a little tweaking of the init 
scripts at most.

If you should have a crash and suspect there is useful data in the buffer, 
you can boot to single-user mode (avoiding the clear) and retrieve it 
manually.

Seems like this should make everyone happy.

-- 

Nate Eldredge
neldredge at math.ucsd.edu


More information about the freebsd-hackers mailing list