unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCHES] Syslog produces no log (just for me?)
@ 2015-03-28 13:24 Alex Kost
  2015-03-29 14:03 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Kost @ 2015-03-28 13:24 UTC (permalink / raw)
  To: guix-devel

[-- 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-01 20:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-28 13:24 [PATCHES] Syslog produces no log (just for me?) Alex Kost
2015-03-29 14:03 ` 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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).