Subject: Re: [bug#30498] [WIP v2 shepherd] shepherd: If /dev/kmsg is writable, use it for logging.

From: [email-masked] (Ludovic Courtès)
Date: Tue, 27 Feb 2018 10:22:28 +0100

Hi!

Danny Milosavljevic <[email-masked]> skribis:

> From 40426570679e83fff25eadbcc20476ebc321740f Mon Sep 17 00:00:00 2001
> From: Danny Milosavljevic <[email-masked]>
> Date: Sat, 17 Feb 2018 17:44:34 +0100
> Subject: [PATCH v2] shepherd: If /dev/kmsg is writable, use it for logging.
> Tags: patch
>
> * 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.
> * doc/shepherd.texi (logging): Document /dev/kmsg.
                       ^
“Logging”.

> --- a/doc/shepherd.texi
> +++ b/doc/shepherd.texi
> @@ -405,7 +405,8 @@ permissions are not as expected.
>  @cindex logging
>  @cindex log file
>  Log output into @var{file}, or if @var{file} is not given,
> -@code{/var/log/shepherd.log} when running as superuser,
> +@code{/dev/kmsg} when running as superuser (except when this is not possible --
> +then it uses @code{/var/log/shepherd.log}),

Nitpick: it should be three hyphens without surrounding spaces, leading
to an em dash, “like---this”.

Let’s just make sure we have a solution for cryptsetup and then you’re
welcome to push it to shepherd.git!

Thank you,
Ludo’.