klogd -f logname "append to logname" patch

From: Clayton Weaver (cgweav@eskimo.com)
Date: Sun Dec 17 2000 - 04:25:06 EST


(For anyone else who shares the opinion that

  klogd -f /var/log/kmsg -x

should append to its kmsg log file instead of overwriting it.)

-f insulates klogd messages from syslogd bugs (although you can't split
them up into multiple files the way that /etc/syslog.conf enables). You
can always solve any klogd-to-syslogd problem *after* you find out what
is otherwise wrong with your kernel (and lose the -f switch then if that's
what you prefer or require). But when you are debugging a kernel deadlock
with no oops, for example, and actually have local persistent storage
to write to, it helps if the next hard reset doesn't truncate the -f
pathname when klogd opens it.

--- klogd.c.orig Mon Sep 18 00:34:11 2000
+++ klogd.c Wed Nov 29 14:06:40 2000
@@ -1109,7 +1109,7 @@
         {
                 if ( strcmp(output, "-") == 0 )
                         output_file = stdout;
- else if ( (output_file = fopen(output, "w")) == (FILE *) 0 )
+ else if ( (output_file = fopen(output, "a")) == (FILE *) 0 )
                 {
                         fprintf(stderr, "klogd: Cannot open output file " \
                                 "%s - %s\n", output, strerror(errno));

Regards,

Clayton Weaver
<mailto:cgweav@eskimo.com>
(Seattle)

"Everybody's ignorant, just in different subjects." Will Rogers

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 23 2000 - 21:00:18 EST