all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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: Mon, 26 Feb 2018 19:04:44 +0100	[thread overview]
Message-ID: <87muzvtyo3.fsf@gnu.org> (raw)
In-Reply-To: <20180217164835.1178-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Sat, 17 Feb 2018 17:48:35 +0100")

Hi!

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> * modules/shepherd.scm (main): If /dev/kmsg is used, don't log to console
> again - use only /dev/kmsg.  Also redirect stderr to /dev/kmsg in
> that case.
> * modules/shepherd/comm.scm (%current-logfile-date-format): New variable.
> (make-shepherd-output-port): Use it.  Export.
> * modules/shepherd/support.scm (default-logfile-date-format): New variable.
> (default-logfile): Use /dev/kmsg if writable.
> (default-logfile-date-format): Drop duplicate timestamp.

[...]

> --- a/modules/shepherd.scm
> +++ b/modules/shepherd.scm
> @@ -141,12 +141,20 @@
>      ;; Enable logging as first action.
>      (start-logging logfile)
>  
> +    (if (string=? logfile "/dev/kmsg")
> +        ;; Prevent duplicate messages.
> +        (set-current-output-port (%make-void-port "w")))

Nitpick: I’d use ‘when’ here since there’s no ‘else’ branch.

> +(define %current-logfile-date-format
> +  (make-parameter default-logfile-date-format))

Please add a one-line comment explaining what the format is.

Could you also add a couple of lines in the .texi file explaining that
/dev/kmsg is used when it’s available and we’re running as root?

As for cryptsetup, what if the service that runs crypsetup simply
parameterizes ‘log-output-port’ to /dev/console?  That would give us the
current behavior, right?

Apart from that it LGTM, thank you!

Ludo’.

  parent reply	other threads:[~2018-02-26 18:05 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 [this message]
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
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=87muzvtyo3.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.