From owner-freebsd-hackers Thu Aug 2 2:57:27 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (unknown [217.75.135.246]) by hub.freebsd.org (Postfix) with SMTP id 76E9B37B401 for ; Thu, 2 Aug 2001 02:57:06 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 11685 invoked by uid 1000); 2 Aug 2001 09:55:01 -0000 Date: Thu, 2 Aug 2001 12:55:01 +0300 From: Peter Pentchev To: Dima Dorfman Cc: Kris Kennaway , Hans Zaunere , freebsd-hackers@FreeBSD.ORG Subject: Re: Accessing /dev/klog and similar Message-ID: <20010802125501.C11273@ringworld.oblivion.bg> Mail-Followup-To: Dima Dorfman , Kris Kennaway , Hans Zaunere , freebsd-hackers@FreeBSD.ORG References: <20010801201146.C4274@ringworld.oblivion.bg> <20010801185857.7D5BE3E31@bazooka.unixfreak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010801185857.7D5BE3E31@bazooka.unixfreak.org>; from dima@unixfreak.org on Wed, Aug 01, 2001 at 11:58:52AM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 01, 2001 at 11:58:52AM -0700, Dima Dorfman wrote: > Peter Pentchev writes: > > 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)? > > Take a look at how it spits out those messages and you'll see why. In > short, if you have two processes reading them, neither will get the > full set because a read advances the read pointer (msgbufp->bufp, > IIRC). This can't easily be fixed. Oh, ok. Makes sense. To answer the original poster once again: currently, there is no way to have more than one process reading from the klog device. Enabling this kind of functionality would require major (not really needed) changes to the kernel logging routines. G'luck, Peter -- If you think this sentence is confusing, then change one pig. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message