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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to