[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#54997] [PATCH v2 08/15] services: dicod: Use 'make-inetd-constructo
From: |
Ludovic Courtès |
Subject: |
[bug#54997] [PATCH v2 08/15] services: dicod: Use 'make-inetd-constructor'. |
Date: |
Wed, 27 Apr 2022 18:56:28 +0200 |
* gnu/services/dict.scm (dicod-shepherd-service): Use
'make-inetd-constructor' in the 'start' method when available.
---
gnu/services/dict.scm | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm
index 62b21f8d53..109917c05c 100644
--- a/gnu/services/dict.scm
+++ b/gnu/services/dict.scm
@@ -146,6 +146,7 @@ (define %dicod-activation
(define (dicod-shepherd-service config)
(let* ((dicod.conf (dicod-configuration-file config))
+ (interfaces (dicod-configuration-interfaces config))
(dicod (least-authority-wrapper
(file-append (dicod-configuration-dico config)
"/bin/dicod")
@@ -165,10 +166,19 @@ (define (dicod-shepherd-service config)
(provision '(dicod))
(requirement '(user-processes))
(documentation "Run the dicod daemon.")
- (start #~(make-forkexec-constructor
- (list #$dicod "--foreground"
- (string-append "--config=" #$dicod.conf))
- #:user "dicod" #:group "dicod"))
+ (start #~(if (and (defined? 'make-inetd-constructor)
+ #$(= 1 (length interfaces))) ;XXX
+ (make-inetd-constructor
+ (list #$dicod "--inetd" "--foreground"
+ (string-append "--config=" #$dicod.conf))
+ (addrinfo:addr
+ (car (getaddrinfo #$(first interfaces) "dict")))
+ #:user "dicod" #:group "dicod"
+ #:service-name-stem "dicod")
+ (make-forkexec-constructor
+ (list #$dicod "--foreground"
+ (string-append "--config=" #$dicod.conf))
+ #:user "dicod" #:group "dicod")))
(stop #~(make-kill-destructor))))))
(define dicod-service-type
--
2.35.1
- [bug#54997] [PATCH 04/12] Add (guix least-authority)., (continued)
- [bug#54997] [PATCH 04/12] Add (guix least-authority)., Thiago Jung Bauermann, 2022/04/22
- [bug#54997] [PATCH 00/12] Add "least authority" program wrapper, Ludovic Courtès, 2022/04/26
- [bug#54997] [PATCH 00/12] Add "least authority" program wrapper, Ludovic Courtès, 2022/04/26
- [bug#54997] [PATCH v2 00/15] Add "least authority" program wrapper, Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 01/15] gexp: Add 'references-file'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 05/15] linux-container: Add #:child-is-pid1? parameter to 'call-with-container'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 03/15] linux-container: 'call-with-container' relays SIGTERM and SIGINT., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 04/15] linux-container: Ensure signal-handling asyncs get a chance to run., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 02/15] file-systems: Avoid load-time warnings when attempting to load (guix store)., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 12/15] services: wesnothd: Grant write access to /var/run/wesnothd., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 08/15] services: dicod: Use 'make-inetd-constructor'.,
Ludovic Courtès <=
- [bug#54997] [PATCH v2 06/15] Add (guix least-authority)., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 07/15] services: dicod: Rewrite using 'least-authority-wrapper'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 13/15] services: wesnothd: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 10/15] services: ipfs: Adjust for Shepherd 0.9., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 09/15] services: bitlbee: Use 'make-inetd-constructor'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 11/15] services: ipfs: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 14/15] services: quassel: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 15/15] services: opendht: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/27
[bug#54997] [PATCH 05/12] services: dicod: Rewrite using 'least-authority-wrapper'., Ludovic Courtès, 2022/04/17
[bug#54997] [PATCH 07/12] services: bitlbee: Use 'make-inetd-constructor'., Ludovic Courtès, 2022/04/17