From patchwork Fri Mar 10 13:33:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 47837 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 603B116E74; Fri, 10 Mar 2023 13:36:24 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 78A5E16D05 for ; Fri, 10 Mar 2023 13:36:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pacui-0002cY-CA; Fri, 10 Mar 2023 08:36:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pacug-0002cI-MU for guix-patches@gnu.org; Fri, 10 Mar 2023 08:36:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pacug-00038O-EF for guix-patches@gnu.org; Fri, 10 Mar 2023 08:36:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pacug-0001tD-97 for guix-patches@gnu.org; Fri, 10 Mar 2023 08:36:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61956] [PATCH v4] services: dns: Extend dnsmasq-configuration. References: <20230304082719.29479-1-sarg@sarg.org.ru> In-Reply-To: <20230304082719.29479-1-sarg@sarg.org.ru> Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Mar 2023 13:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61956 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61956@debbugs.gnu.org Cc: Sergey Trofimov Received: via spool by 61956-submit@debbugs.gnu.org id=B61956.16784553477241 (code B ref 61956); Fri, 10 Mar 2023 13:36:02 +0000 Received: (at 61956) by debbugs.gnu.org; 10 Mar 2023 13:35:47 +0000 Received: from localhost ([127.0.0.1]:54084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pacuQ-0001sj-LS for submit@debbugs.gnu.org; Fri, 10 Mar 2023 08:35:46 -0500 Received: from mail-ed1-f43.google.com ([209.85.208.43]:43933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pacuN-0001sT-4Q for 61956@debbugs.gnu.org; Fri, 10 Mar 2023 08:35:45 -0500 Received: by mail-ed1-f43.google.com with SMTP id x3so20432502edb.10 for <61956@debbugs.gnu.org>; Fri, 10 Mar 2023 05:35:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1678455337; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hL/J5PzLhwzXz9dLYRKFINwyGUNgAACNiXMokjzd/jw=; b=J9HTW8QLt5Z27PtwLxYRL2FTyW62R7Ua/QlaJm9J37WXYXuURfPz7KnfoNezS4KhcB c5nD47BiSSj76RNrVjLAoy7vLuwQJmr7Xuh7DpdF37+M9BaWif3kMHE7dvkKJ1v1IfOJ ipelIj0F0c6V+qQLzqS632K+PR5bF1kEVuk1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678455337; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hL/J5PzLhwzXz9dLYRKFINwyGUNgAACNiXMokjzd/jw=; b=iQAhpv9buXL2co40wD5a4pIQhyMTiDvoZT84C72/SORLY4/nRcWvZRU3ojWvr08icd 3zomNREAP2mrApLTaPWJHuAPVNUj53RE9r/odOshRFP6QvEgk9E+MSFO61owGu6+gWpB InbBfNtTDjvC6QwmwRLlyogrQw8zs3kCZrAwhu4dn2WViAsqxwcDBISyYVePk7r5ayr+ wbrleHvR+LWZZC4Exy78oeps6CEqGhBrxIr/CkHTArNRUaFQzuKR0tILY3G1YvapFikF pwiE2+7vuEwvvrrfdQ6QVaD2HS3WRv+imfBwDlm3DAH7WLBnIN0rcXXOyRuekZ8MuTbt tq9Q== X-Gm-Message-State: AO0yUKXIxSCGLyDN0zqheV2CVeqANMtqK3LoZtujvDd1J7Lq23E+Z/Rd 6Nl7hiBI2o6OpqEKBEsE3P4oDlwMvSXTtqFp+Gtjsw== X-Google-Smtp-Source: AK7set/0PXE8UC8DuRk4yhb73f+XQDAqhkt/jIBoBOC36aUpkyJgSW3x1owCUuvBhcQOz4GxJkdZsw== X-Received: by 2002:a17:906:4f94:b0:87b:d400:e1df with SMTP id o20-20020a1709064f9400b0087bd400e1dfmr25346388eju.72.1678455336952; Fri, 10 Mar 2023 05:35:36 -0800 (PST) Received: from localhost ([95.168.145.203]) by smtp.gmail.com with ESMTPSA id x24-20020a1709064bd800b008d269233bd4sm946895ejv.204.2023.03.10.05.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:35:36 -0800 (PST) From: Sergey Trofimov Date: Fri, 10 Mar 2023 14:33:09 +0100 Message-Id: <20230310133308.13048-1-sarg@sarg.org.ru> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/service/dns.scm: ()[servers-file]: Add. ()[tftp-secure?]: Fix typo in parameter name. * doc/guix.texi: Document ()[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..21af2b2611 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -754,6 +754,8 @@ (define-record-type* (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") + `(#$(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))