From ec2e2f6ce2f808de20f4770748db43aefd46f0bf Mon Sep 17 00:00:00 2001 From: David Craven Date: Sat, 27 Aug 2016 15:38:55 +0200 Subject: services: syslog: Use syslog-configuration. * gnu/services/base.scm (): New variable. (syslog-service-type): Use . (syslog-service): Use . * gnu/tests/base.scm (%avahi-os): Use . * doc/guix.texi (syslog-configuration-type): Add @deftp. (syslog-service): Update @deffn. --- gnu/services/base.scm | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index f3f6408687..2c2962cd8c 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -82,6 +82,9 @@ (define-module (gnu services base) nscd-service-type nscd-service + + syslog-configuration + syslog-configuration? syslog-service syslog-service-type %default-syslog.conf @@ -885,17 +888,27 @@ (define* (nscd-service #:optional (config %nscd-default-configuration)) Service Switch}, for an example." (service nscd-service-type config)) + +(define-record-type* + syslog-configuration make-syslog-configuration + syslog-configuration? + (syslogd syslog-configuration-syslogd + (default #~(string-append #$inetutils "/libexec/syslogd"))) + (config-file syslog-configuration-config-file + (default %default-syslog.conf))) + (define syslog-service-type (shepherd-service-type 'syslog - (lambda (config-file) + (lambda (config) (shepherd-service (documentation "Run the syslog daemon (syslogd).") (provision '(syslogd)) (requirement '(user-processes)) (start #~(make-forkexec-constructor - (list (string-append #$inetutils "/libexec/syslogd") - "--no-detach" "--rcfile" #$config-file))) + (list #$(syslog-configuration-syslogd config) + "--no-detach" + "--rcfile" #$(syslog-configuration-config-file config)))) (stop #~(make-kill-destructor)))))) ;; Snippet adapted from the GNU inetutils manual. @@ -921,14 +934,14 @@ (define %default-syslog.conf mail.* /var/log/maillog ")) -(define* (syslog-service #:key (config-file %default-syslog.conf)) - "Return a service that runs @command{syslogd}. If configuration file -name @var{config-file} is not specified, use some reasonable default -settings. +(define* (syslog-service #:optional (config (syslog-configuration))) + "Return a service that runs @command{syslogd} and takes +@var{} as a parameter. @xref{syslogd invocation,,, inetutils, GNU Inetutils}, for more information on the configuration file syntax." - (service syslog-service-type config-file)) + (service syslog-service-type config)) + (define pam-limits-service-type (let ((security-limits -- cgit v1.2.3