all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: 45mg <45mg.writes@gmail.com>
To: 75140@debbugs.gnu.org
Cc: 45mg <45mg.writes@gmail.com>, "Ludovic Courtès" <ludo@gnu.org>,
	"Maxim Cournoyer" <maxim.cournoyer@gmail.com>
Subject: [bug#75140] [PATCH] services: dnsmasq: Allow custom Shepherd provision
Date: Fri, 27 Dec 2024 08:29:52 -0500	[thread overview]
Message-ID: <ff4ae53bbfcf15ebdbcee8a664fb518dde0b6dc0.1735306191.git.45mg.writes@gmail.com> (raw)

Allow users to have multiple dnsmasq instances by specifying different
`provision` values for the corresponding Shepherd services, similar to
what is done with `static-networking-service-type`.

* gnu/services/dns.scm (<dnsmasq-configuration>)[provision]: new option.
(dnsmasq-shepherd-service): Use supplied provision value.
* doc/guix.texi (DNS Services)[dnsmasq-configuration]: Document it.

Change-Id: I78c7f015cb1db239a600bc5373b2fd80e8b9b9f4
---
 doc/guix.texi        | 4 ++++
 gnu/services/dns.scm | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index da4d2f5ebc..e9547ea8f2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -34129,6 +34129,10 @@ DNS Services
 @item @code{package} (default: @var{dnsmasq})
 Package object of the dnsmasq server.
 
+@item @code{provision} (default: @code{'(dnsmasq)})
+A list of symbols for the Shepherd service corresponding to this dnsmasq
+configuration.
+
 @item @code{no-hosts?} (default: @code{#f})
 When true, don't read the hostnames in /etc/hosts.
 
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index 043c34599c..532e20e38a 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -731,6 +731,8 @@ (define-record-type* <dnsmasq-configuration>
   dnsmasq-configuration?
   (package          dnsmasq-configuration-package
                     (default dnsmasq))  ;file-like
+  (provision        dnsmasq-provision
+                    (default '(dnsmasq)))
   (no-hosts?        dnsmasq-configuration-no-hosts?
                     (default #f))       ;boolean
   (port             dnsmasq-configuration-port
@@ -802,7 +804,7 @@ (define (dnsmasq-shepherd-service config)
      tftp-lowercase? tftp-port-range
      tftp-root tftp-unique-root extra-options)
     (shepherd-service
-     (provision '(dnsmasq))
+     (provision (dnsmasq-provision config))
      (requirement '(networking))
      (documentation "Run the dnsmasq DNS server.")
      (start #~(make-forkexec-constructor

base-commit: 831b94a1efcea8f793afc949b5123a6235c9bb1a
-- 
2.47.1





             reply	other threads:[~2024-12-27 13:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-27 13:29 45mg [this message]
2024-12-28  5:35 ` [bug#75140] [PATCH] services: dnsmasq: Allow custom Shepherd provision Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff4ae53bbfcf15ebdbcee8a664fb518dde0b6dc0.1735306191.git.45mg.writes@gmail.com \
    --to=45mg.writes@gmail.com \
    --cc=75140@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.