[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/14: services: dicod: Use 'make-inetd-constructor'.
From: |
guix-commits |
Subject: |
08/14: services: dicod: Use 'make-inetd-constructor'. |
Date: |
Sun, 1 May 2022 16:15:33 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit fd57ce267c4083fe98242caa31075d2bd62903bf
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Apr 16 17:34:30 2022 +0200
services: dicod: Use 'make-inetd-constructor'.
* 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 @@ database {
(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 @@ database {
(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
- 11/14: services: wesnothd: Grant write access to /var/run/wesnothd., (continued)
- 11/14: services: wesnothd: Grant write access to /var/run/wesnothd., guix-commits, 2022/05/01
- 02/14: file-systems: Avoid load-time warnings when attempting to load (guix store)., guix-commits, 2022/05/01
- 06/14: Add (guix least-authority)., guix-commits, 2022/05/01
- 09/14: services: bitlbee: Use 'make-inetd-constructor'., guix-commits, 2022/05/01
- 04/14: linux-container: Ensure signal-handling asyncs get a chance to run., guix-commits, 2022/05/01
- 10/14: services: ipfs: Use 'least-authority-wrapper'., guix-commits, 2022/05/01
- 12/14: services: wesnothd: Use 'least-authority-wrapper'., guix-commits, 2022/05/01
- 01/14: gexp: Add 'references-file'., guix-commits, 2022/05/01
- 14/14: services: opendht: Use 'least-authority-wrapper'., guix-commits, 2022/05/01
- 13/14: services: quassel: Use 'least-authority-wrapper'., guix-commits, 2022/05/01
- 08/14: services: dicod: Use 'make-inetd-constructor'.,
guix-commits <=
- 07/14: services: dicod: Rewrite using 'least-authority-wrapper'., guix-commits, 2022/05/01
- 05/14: linux-container: Add #:child-is-pid1? parameter to 'call-with-container'., guix-commits, 2022/05/01