From 5a0b78e62bc3122998990cea5ee17bdb2789aada Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Fri, 10 Apr 2020 17:00:47 +0100 Subject: services: dnsmasq: Support the --address flag. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a new `addresses' field that translates to passing `--address=' multiple times to dnsmasq. * gnu/services/dns.scm (): Add an addresses field. (dnsmasq-shepherd-service): Match the addresses field and translate it to multiple '--address=' flags. * doc/guix.texi (DNS Services): Document it. Signed-off-by: 宋文武 --- gnu/services/dns.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index a07946d085..478c837d13 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Julien Lepiller ;;; Copyright © 2018 Oleg Pykhalov +;;; Copyright © 2020 Pierre Langlois ;;; ;;; This file is part of GNU Guix. ;;; @@ -748,6 +749,8 @@ cache.size = 100 * MB (default #f)) ;boolean (servers dnsmasq-configuration-servers (default '())) ;list of string + (addresses dnsmasq-configuration-addresses + (default '())) ;list of string (cache-size dnsmasq-configuration-cache-size (default 150)) ;integer (negative-cache? dnsmasq-configuration-negative-cache? @@ -759,7 +762,7 @@ cache.size = 100 * MB no-hosts? port local-service? listen-addresses resolv-file no-resolv? servers - cache-size negative-cache?) + addresses cache-size negative-cache?) (shepherd-service (provision '(dnsmasq)) (requirement '(networking)) @@ -783,6 +786,8 @@ cache.size = 100 * MB '()) #$@(map (cut format #f "--server=~a" <>) servers) + #$@(map (cut format #f "--address=~a" <>) + addresses) #$(format #f "--cache-size=~a" cache-size) #$@(if negative-cache? '() -- cgit v1.2.3 From 4c0cc7bed3de2c0e2d3a6e95b88693941e839eec Mon Sep 17 00:00:00 2001 From: Diego Nicola Barbato Date: Tue, 28 Apr 2020 13:31:54 +0200 Subject: services: syslog: Simplify 'start' method. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a followup to d7113bb655ff80a868a9e624c913f9d23e6c63ad and e3358a831e7d5d9e8dc614340e49ea5aeb11a7ff. * gnu/services/base.scm (syslog-service-type): Change 'start' method to set umask using the #:file-creation-mask parameter of 'make-forkexec-constructor' introduced in version 0.8.0 of the Shepherd. Signed-off-by: Ludovic Courtès --- gnu/services/base.scm | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 2913478e4a..0f119cc2f9 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1316,17 +1316,13 @@ Service Switch}, for an example." (documentation "Run the syslog daemon (syslogd).") (provision '(syslogd)) (requirement '(user-processes)) - (start #~(let ((spawn (make-forkexec-constructor - (list #$(syslog-configuration-syslogd config) - "--rcfile" - #$(syslog-configuration-config-file config)) - #:pid-file "/var/run/syslog.pid"))) - (lambda () - ;; Set the umask such that file permissions are #o640. - (let ((mask (umask #o137)) - (pid (spawn))) - (umask mask) - pid)))) + (start #~(make-forkexec-constructor + (list #$(syslog-configuration-syslogd config) + "--rcfile" + #$(syslog-configuration-config-file config)) + ;; Set the umask such that file permissions are #o640. + #:file-creation-mask #o137 + #:pid-file "/var/run/syslog.pid")) (stop #~(make-kill-destructor)))))) ;; Snippet adapted from the GNU inetutils manual. -- cgit v1.2.3