Hello, I noticed that my /var/log/messages (and other log files and tty12) were not filled anymore. I found that the problem is in "syslog.conf": when the "rule" lines begin with spaces, they are ignored, so I'm attaching a patch to fix it.¹
The strange thing is it worked earlier (with the same config) and since nobody noticed that before, I have a feeling that it might be the problem on my computer. So I appreciate if someone confirms that the problem really exists. Also I think it would be good to allow a user to specify his own configuration file for syslogd (a patch is also attached²). WDYT? Thanks, Alex.
>From 2292c9edd1747cda4f0b3f3b964698d3961dfc5d Mon Sep 17 00:00:00 2001 From: Alex Kost <[email protected]> Date: Sat, 28 Mar 2015 15:29:55 +0300 Subject: [PATCH 1/2] services: syslog-service: Fix syslog configuration. * gnu/services/base.scm (syslog-service): Remove leading spaces from the contents of syslog configuration. --- gnu/services/base.scm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 24e6d32..f5ee8f5 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -531,24 +531,24 @@ given @var{config}---an @code{<nscd-configuration>} object. Optionally, ;; Snippet adapted from the GNU inetutils manual. (define contents " - # Log all error messages, authentication messages of - # level notice or higher and anything of level err or - # higher to the console. - # Don't log private authentication messages! - *.alert;auth.notice;authpriv.none /dev/console +# Log all error messages, authentication messages of +# level notice or higher and anything of level err or +# higher to the console. +# Don't log private authentication messages! +*.alert;auth.notice;authpriv.none /dev/console - # Log anything (except mail) of level info or higher. - # Don't log private authentication messages! - *.info;mail.none;authpriv.none /var/log/messages +# Log anything (except mail) of level info or higher. +# Don't log private authentication messages! +*.info;mail.none;authpriv.none /var/log/messages - # Same, in a different place. - *.info;mail.none;authpriv.none /dev/tty12 +# Same, in a different place. +*.info;mail.none;authpriv.none /dev/tty12 - # The authpriv file has restricted access. - authpriv.* /var/log/secure +# The authpriv file has restricted access. +authpriv.* /var/log/secure - # Log all the mail messages in one place. - mail.* /var/log/maillog +# Log all the mail messages in one place. +mail.* /var/log/maillog ") (mlet %store-monad -- 2.2.1
>From f66520181a65566b1f191583c3e1344c1af93ecc Mon Sep 17 00:00:00 2001 From: Alex Kost <[email protected]> Date: Sat, 28 Mar 2015 15:42:23 +0300 Subject: [PATCH 2/2] services: syslog-service: Add 'config-file' argument. * gnu/services/base.scm (syslog-service): Add 'config-file' keyword argument. * doc/guix.texi (Base Services): Document it. --- doc/guix.texi | 5 +++-- gnu/services/base.scm | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 3c72e65..73d79e3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4489,8 +4489,9 @@ external name servers do not even need to be queried. @end defvr -@deffn {Monadic Procedure} syslog-service -Return a service that runs @code{syslogd} with reasonable default +@deffn {Monadic Procedure} syslog-service [#:config-file #f] +Return a service that runs @code{syslogd}. If configuration file name +@var{config-file} is not specified, use some reasonable default settings. @end deffn diff --git a/gnu/services/base.scm b/gnu/services/base.scm index f5ee8f5..d752948 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -526,8 +526,10 @@ given @var{config}---an @code{<nscd-configuration>} object. Optionally, (respawn? #f))))) -(define (syslog-service) - "Return a service that runs @code{syslogd} with reasonable default settings." +(define* (syslog-service #:key config-file) + "Return a service that runs @code{syslogd}. +If configuration file name @var{config-file} is not specified, use some +reasonable default settings." ;; Snippet adapted from the GNU inetutils manual. (define contents " @@ -561,7 +563,7 @@ mail.* /var/log/maillog (start #~(make-forkexec-constructor (list (string-append #$inetutils "/libexec/syslogd") - "--no-detach" "--rcfile" #$syslog.conf))) + "--no-detach" "--rcfile" #$(or config-file syslog.conf)))) (stop #~(make-kill-destructor)))))) (define* (guix-build-accounts count #:key -- 2.2.1
