GNU bug report logs -
#30498
[PATCH shepherd] shepherd: If /dev/kmsg is writable, use it for logging.
Previous Next
Full log
Message #17 received at 30498 <at> debbugs.gnu.org (full text, mbox):
Hi!
Danny Milosavljevic <dannym <at> 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’.
This bug report was last modified 7 years and 126 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.