GNU bug report logs -
#61956
[PATCH] services: dns: Extend dnsmasq-configuration.
Previous Next
Reported by: Sergey Trofimov <sarg <at> sarg.org.ru>
Date: Sat, 4 Mar 2023 08:28:01 UTC
Severity: normal
Tags: patch
Done: Sergey Trofimov <sarg <at> sarg.org.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 2023-03-10 16:00, Sergey Trofimov wrote:
> * gnu/service/dns.scm: (<dnsmasq-configuration>)[servers-file]: Add.
> (<dnsmasq-configuration>)[tftp-secure?]: Fix typo in parameter name.
> * doc/guix.texi: Document (<dnsmasq-configuration>)[servers-file].
> ---
> doc/guix.texi | 4 ++++
> gnu/services/dns.scm | 11 ++++++++---
> 2 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 6671ba9305..debff95466 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -31502,6 +31502,10 @@ in @var{servers}.
> @item @code{servers} (default: @code{'()})
> Specify IP address of upstream servers directly.
>
> +@item @code{servers-file} (default: @code{#f})
> +Specify file containing upstream servers. This file is re-read when dnsmasq receives SIGHUP.
> +Could be either a string or a file-like object.
> +
> @item @code{addresses} (default: @code{'()})
> For each entry, specify an IP address to return for any host in the
> given domains. Queries in the domains are never forwarded and always
> diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
> index 32fb8c0664..aaa2b6e47f 100644
> --- a/gnu/services/dns.scm
> +++ b/gnu/services/dns.scm
> @@ -754,6 +754,8 @@ (define-record-type* <dnsmasq-configuration>
> (default #f)) ;boolean
> (servers dnsmasq-configuration-servers
> (default '())) ;list of string
> + (servers-file dnsmasq-configuration-servers-file
> + (default #f)) ;string|file-like
> (addresses dnsmasq-configuration-addresses
> (default '())) ;list of string
> (cache-size dnsmasq-configuration-cache-size
> @@ -792,7 +794,7 @@ (define (dnsmasq-shepherd-service config)
> port local-service? listen-addresses
> resolv-file no-resolv?
> forward-private-reverse-lookup? query-servers-in-order?
> - servers addresses
> + servers addresses servers-file
> cache-size negative-cache?
> cpe-id
> tftp-enable? tftp-no-fail?
> @@ -805,7 +807,7 @@ (define (dnsmasq-shepherd-service config)
> (requirement '(networking))
> (documentation "Run the dnsmasq DNS server.")
> (start #~(make-forkexec-constructor
> - '(#$(file-append package "/sbin/dnsmasq")
> + (list #$(file-append package "/sbin/dnsmasq")
> "--keep-in-foreground"
> "--pid-file=/run/dnsmasq.pid"
> #$@(if no-hosts?
> @@ -827,6 +829,9 @@ (define (dnsmasq-shepherd-service config)
> #$@(if query-servers-in-order?
> '("--strict-order")
> '())
> + #$@(if servers-file
> + (list #~(string-append "--servers-file=" #$servers-file))
> + '())
> #$@(map (cut format #f "--server=~a" <>)
> servers)
> #$@(map (cut format #f "--address=~a" <>)
> @@ -848,7 +853,7 @@ (define (dnsmasq-shepherd-service config)
> '("--tftp-single-port")
> '())
> #$@(if tftp-secure?
> - '("--tftp-secure?")
> + '("--tftp-secure")
> '())
> #$@(if tftp-max
> (list (format #f "--tftp-max=~a" tftp-max))
Hi Sergey!
Thank you for the patch, applied, realigned make-forkexec-constructor
arguments, pushed as d1edb26388ca4dab4b435a686cd059d97c113c3e.
--
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 1 year and 21 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.