Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Nov 2001 13:27:49 +0200
From:      Peter Pentchev <roam@ringlet.net>
To:        Dima Dorfman <dima@trit.org>
Cc:        Peter Wemm <peter@wemm.org>, Bruce Evans <bde@zeta.org.au>, hackers@freebsd.org
Subject:   Re: Reducing syslogd output bloat (was: cvs commit: src/sys/conf Makefile.i386)
Message-ID:  <20011125132748.A522@straylight.oblivion.bg>
In-Reply-To: <20011125004921.93AD54020@bazooka.trit.org>; from dima@trit.org on Sun, Nov 25, 2001 at 12:49:16AM %2B0000
References:  <20011021183958.24ABB3803@overcee.netplex.com.au> <20011125004921.93AD54020@bazooka.trit.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 25, 2001 at 12:49:16AM +0000, Dima Dorfman wrote:
> The attached patch implements something like this:
> 
> 	Make the default kernel prefix "kernel:" instead of the boot file,
> 	with the old behavior available via the -o option (it might still be
> 	useful if one has many kernels and cares which messages came from
> 	which).  If the boot file is not used as the prefix, it is still
> 	logged once at startup.
> 
> 	This change is prompted by the fact that the boot file is now much
> 	longer ("/boot/kernel/kernel" vs. "/kernel"), which significanlty
> 	bloats the syslogd output.
> 
> Please review and comment.

Nice work; just a couple of comments..

> @@ -181,6 +181,12 @@
>  messages; the default is 20 minutes.
>  .It Fl n
>  Disable dns query for every request.
> +.It Fl o
> +Prefix kernel messages with the full kernel boot file as determined by
> +.Xr getbootfile 3 .
> +Without this,
> +the kernel message prefix is always

Do these two really need to be on separate lines?

> Index: syslogd.c
> ===================================================================
> RCS file: /ref/cvsf/src/usr.sbin/syslogd/syslogd.c,v
> retrieving revision 1.92
> diff -u -r1.92 syslogd.c
> --- syslogd.c	2001/11/14 09:20:24	1.92
> +++ syslogd.c	2001/11/25 00:42:26
> @@ -273,6 +273,7 @@
>  int	family = PF_INET;	/* protocol family (IPv4 only) */
>  #endif
>  int	send_to_all = 0;	/* send message to all IPv4/IPv6 addresses */
> +int	use_bootfile = 0;	/* log entire bootfile for every kern msg */

I think 'boot filename' would be more appropriate at least in the comment.

> @@ -1525,6 +1531,16 @@
>  		    oldLocalHostName, LocalHostName);
>  		logmsg(LOG_SYSLOG|LOG_INFO, hostMsg, LocalHostName, ADDDATE);
>  		dprintf("%s\n", hostMsg);
> +	}
> +	/*
> +	 * Log the kernel boot file if we aren't going to use it as
> +	 * the prefix, and if this is *not* a restart.
> +	 */
> +	if (signo == 0 && !use_bootfile) {
> +		(void)snprintf(bootfileMsg, sizeof(bootfileMsg),
> +		    "syslogd: kernel boot file is %s", bootfile);

Maybe something like 'boot(ed) kernel file name'?

Other than those minor issues, I like this patch a lot.

G'luck,
Peter

-- 
If I had finished this sentence,

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?20011125132748.A522>