From: Alex Kost <alezost@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCHES] Syslog produces no log (just for me?)
Date: Sat, 28 Mar 2015 16:24:21 +0300 [thread overview]
Message-ID: <87twx5qmpm.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 641 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-services-syslog-service-Fix-syslog-configuration.patch --]
[-- Type: text/x-patch, Size: 2233 bytes --]
From 2292c9edd1747cda4f0b3f3b964698d3961dfc5d Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-services-syslog-service-Add-config-file-argument.patch --]
[-- Type: text/x-patch, Size: 2089 bytes --]
From f66520181a65566b1f191583c3e1344c1af93ecc Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
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
next reply other threads:[~2015-03-28 13:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-28 13:24 Alex Kost [this message]
2015-03-29 14:03 ` [PATCHES] Syslog produces no log (just for me?) Ludovic Courtès
2015-03-30 7:23 ` Alex Kost
2015-03-30 21:20 ` Ludovic Courtès
2015-04-01 9:54 ` Syslog bug Alex Kost
2015-04-01 19:51 ` Ludovic Courtès
2015-04-01 20:34 ` Alex Kost
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=87twx5qmpm.fsf@gmail.com \
--to=alezost@gmail.com \
--cc=guix-devel@gnu.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.