[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/06: services: opensmtpd: Add 'shepherd-requirement' field.
From: |
guix-commits |
Subject: |
05/06: services: opensmtpd: Add 'shepherd-requirement' field. |
Date: |
Tue, 20 Dec 2022 11:13:26 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 00f48860e9df4e83ed9527e3a9f267787ddefee5
Author: Bruno Victal <mirai@makinata.eu>
AuthorDate: Tue Dec 6 16:52:10 2022 +0000
services: opensmtpd: Add 'shepherd-requirement' field.
* gnu/services/mail.scm (<opensmtpd-configuration>)[shepherd-requirement]:
New field.
(opensmtpd-shepherd-service): Honor it.
* doc/guix.texi (Mail Services): Document it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
doc/guix.texi | 5 +++++
gnu/services/mail.scm | 7 +++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 6478deba1d..fd03da8c97 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -25729,6 +25729,11 @@ Data type representing the configuration of opensmtpd.
@item @code{package} (default: @var{opensmtpd})
Package object of the OpenSMTPD SMTP server.
+@item @code{shepherd-requirement} (default: @code{'()})
+This option can be used to provide a list of symbols naming Shepherd services
+that this service will depend on, such as @code{'networking}
+if you want to configure OpenSMTPD to listen on non-loopback interfaces.
+
@item @code{config-file} (default: @code{%default-opensmtpd-config-file})
File-like object of the OpenSMTPD configuration file to use. By default
it listens on the loopback network interface, and allows for mail from
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index dc4a7986b6..6f588679b1 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -1651,6 +1651,8 @@ by @code{dovecot-configuration}. @var{config} may also
be created by
opensmtpd-configuration?
(package opensmtpd-configuration-package
(default opensmtpd))
+ (shepherd-requirement opensmtpd-configuration-shepherd-requirement
+ (default '())) ; list of symbols
(config-file opensmtpd-configuration-config-file
(default %default-opensmtpd-config-file))
(setgid-commands? opensmtpd-setgid-commands? (default #t)))
@@ -1667,10 +1669,11 @@ match from local for any action outbound
"))
(define (opensmtpd-shepherd-service config)
- (match-record config <opensmtpd-configuration> (package config-file)
+ (match-record config <opensmtpd-configuration>
+ (package config-file shepherd-requirement)
(list (shepherd-service
(provision '(smtpd))
- (requirement '(loopback))
+ (requirement `(loopback ,@shepherd-requirement))
(documentation "Run the OpenSMTPD daemon.")
(start (let ((smtpd (file-append package "/sbin/smtpd")))
#~(make-forkexec-constructor
- branch master updated (7fb27b5441 -> fcc4e51e61), guix-commits, 2022/12/20
- 03/06: cpio: Skip test on inode numbers that don't fit on 32 bits., guix-commits, 2022/12/20
- 04/06: services: opensmtpd: Use 'match-record' instead of 'match'., guix-commits, 2022/12/20
- 06/06: read-print: Add special forms., guix-commits, 2022/12/20
- 02/06: doc: Avoid 'match' on the <udev-configuration> record., guix-commits, 2022/12/20
- 01/06: tests: Adjust 'guix package' test to latest package search metrics., guix-commits, 2022/12/20
- 05/06: services: opensmtpd: Add 'shepherd-requirement' field.,
guix-commits <=