From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 30498@debbugs.gnu.org
Subject: [bug#30498] [WIP v2 shepherd] shepherd: If /dev/kmsg is writable, use it for logging.
Date: Wed, 07 Mar 2018 13:46:22 +0100 [thread overview]
Message-ID: <87po4gt5nl.fsf@gnu.org> (raw)
In-Reply-To: <20180306090905.77f528a9@scratchpost.org> (Danny Milosavljevic's message of "Tue, 6 Mar 2018 09:09:05 +0100")
Hello,
Danny Milosavljevic <dannym@scratchpost.org> skribis:
>> There’s one thing we need to improve though: syslogd reads /proc/kmsg
>> and prefixes everything that comes from there with “vmunix” (as if it
>> came from the kernel).
>
> Also, apparently syslogd uses the timestamp of "when it read the messages
> out of /dev/kmsg" as syslog entry timestamp *although* /dev/kmsg contains its
> own timestamps (as offsets-from-bootup). Hrmmm...
Yeah, we could teach Inetutils’s syslogd to interpret those timestamps,
although that’s a Linux-specific thing so care must be taken.
> According to the Linux kernel documentation the /dev/kmsg ring buffer is
> specifically allowed to be used by user processes (although they must not
> impersonate the kernel - if they try, the specified priority is ignored),
> so we're in the clear there.
Yeah but still. From syslogd’s viewpoint, you can only assume that
these messages originate in the kernel.
> Later on, we should use /dev/log and fall back to /dev/kmsg and
> then again use /dev/log as it gets available etc. I'm not sure
> how to do the synchronisation (from shepherd's point of view,
> syslogd asynchronously reads from /dev/kmsg and puts the messages
> into its output files - so if we write to /dev/kmsg, then to
> /dev/log, then to /dev/kmsg, then to /dev/log, is the message order
> guaranteed?)
syslogd will read a batch of messages from /dev/kmsg when it starts, so
the order is not really honored in this case. I think that’s OK though,
because we don’t expect users to keep stopping/starting syslogd. :-)
Thanks,
Ludo’.
next prev parent reply other threads:[~2018-03-07 12:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-17 12:20 [bug#30498] [PATCH shepherd] shepherd: If /dev/kmsg is writable, use it for logging Danny Milosavljevic
2018-02-17 12:25 ` Danny Milosavljevic
2018-02-17 16:48 ` [bug#30498] [WIP v2 " Danny Milosavljevic
2018-02-17 16:49 ` Danny Milosavljevic
2018-02-26 18:04 ` Ludovic Courtès
2018-02-26 21:51 ` Danny Milosavljevic
2018-02-27 9:22 ` Ludovic Courtès
2018-02-26 22:32 ` Danny Milosavljevic
2018-02-27 9:19 ` Ludovic Courtès
2018-03-03 21:54 ` Ludovic Courtès
2018-03-03 22:37 ` Danny Milosavljevic
2018-03-05 16:51 ` Ludovic Courtès
2018-03-06 8:09 ` Danny Milosavljevic
2018-03-07 12:46 ` Ludovic Courtès [this message]
2018-03-07 11:04 ` [bug#30498] [PATCH 0/3] Log to syslog whenever possible Ludovic Courtès
2018-03-07 11:04 ` [bug#30498] [PATCH 1/3] Turn 'log-output-port' into a parameter Ludovic Courtès
2018-03-07 11:04 ` [bug#30498] [PATCH 2/3] Simplify 'make-shepherd-output-port' Ludovic Courtès
2018-03-07 11:04 ` [bug#30498] [PATCH 3/3] Use syslog for logging when running as root Ludovic Courtès
2018-03-07 15:25 ` [bug#30498] [PATCH 0/3] Log to syslog whenever possible Ludovic Courtès
2018-03-15 17:00 ` bug#30498: " Ludovic Courtès
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=87po4gt5nl.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=30498@debbugs.gnu.org \
--cc=dannym@scratchpost.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.