linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clayton Weaver <cgweav@eskimo.com>
To: linux-kernel@vger.kernel.org
Subject: klogd -f logname "append to logname" patch
Date: Sun, 17 Dec 2000 01:25:06 -0800 (PST)	[thread overview]
Message-ID: <Pine.SUN.3.96.1001217011004.16489A-100000@eskimo.com> (raw)

(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/

                 reply	other threads:[~2000-12-17  9:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.SUN.3.96.1001217011004.16489A-100000@eskimo.com \
    --to=cgweav@eskimo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).