Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Aug 2001 20:11:46 +0300
From:      Peter Pentchev <roam@orbitel.bg>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        Hans Zaunere <zaunere@yahoo.com>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Accessing /dev/klog and similar
Message-ID:  <20010801201146.C4274@ringworld.oblivion.bg>
In-Reply-To: <20010730143521.A69771@xor.obsecurity.org>; from kris@obsecurity.org on Mon, Jul 30, 2001 at 02:35:21PM -0700
References:  <20010730185018.10922.qmail@web12807.mail.yahoo.com> <20010730143521.A69771@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jul 30, 2001 at 02:35:21PM -0700, Kris Kennaway wrote:
> On Mon, Jul 30, 2001 at 11:50:18AM -0700, Hans Zaunere wrote:
> > Hello,
> > 
> > I'm looking to access kernel messages directly from
> > the kernel, and not through syslog if I can help it.
> 
> Look at how syslogd does it.

Or rather, do not try this while syslogd is running.

src/sys/kern/subr_log.c defines the operation of the /dev/klog
device, and there is an upper limit on the number of processes
that can simultaneously open the log device - the limit is one.
That is, while syslogd is running, no other process can open
the klog device for reading.

This seems to have been the case ever since rev. 1.1 of
src/sys/kern/subr_log.c; that is, this has been the case
in 4.4BSD and earlier.  Anybody have any recollection
on why the kernel won't let more than one process intercept
log messages (aside from the obvious fact that stacked syslogd's
could easily DoS a machine)?

G'luck,
Peter

-- 
because I didn't think of a good beginning of it.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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