services: dicod: Use one inetd endpoint per interface.

* gnu/services/dict.scm (dicod-shepherd-service): Remove
the (= 1 (length interfaces)) restriction by adding one endpoint per
interface.
This commit is contained in:
Ludovic Courtès 2023-06-24 16:10:03 +02:00
parent d6dc82e8cd
commit deeee98a50
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -167,15 +167,15 @@ (define (dicod-shepherd-service config)
(provision '(dicod)) (provision '(dicod))
(requirement '(user-processes)) (requirement '(user-processes))
(documentation "Run the dicod daemon.") (documentation "Run the dicod daemon.")
(start #~(if (and (defined? 'make-inetd-constructor) (start #~(if (defined? 'make-inetd-constructor)
#$(= 1 (length interfaces))) ;XXX
(make-inetd-constructor (make-inetd-constructor
(list #$dicod "--inetd" "--foreground" (list #$dicod "--inetd" "--foreground"
(string-append "--config=" #$dicod.conf)) (string-append "--config=" #$dicod.conf))
(list (endpoint (map (lambda (interface)
(endpoint
(addrinfo:addr (addrinfo:addr
(car (getaddrinfo #$(first interfaces) (car (getaddrinfo interface "dict")))))
"dict"))))) '#$interfaces)
#:requirements '#$requirement #:requirements '#$requirement
#:user "dicod" #:group "dicod" #:user "dicod" #:group "dicod"
#:service-name-stem "dicod") #:service-name-stem "dicod")
@ -183,8 +183,7 @@ (define (dicod-shepherd-service config)
(list #$dicod "--foreground" (list #$dicod "--foreground"
(string-append "--config=" #$dicod.conf)) (string-append "--config=" #$dicod.conf))
#:user "dicod" #:group "dicod"))) #:user "dicod" #:group "dicod")))
(stop #~(if (and (defined? 'make-inetd-destructor) (stop #~(if (defined? 'make-inetd-destructor)
#$(= 1 (length interfaces))) ;XXX
(make-inetd-destructor) (make-inetd-destructor)
(make-kill-destructor))) (make-kill-destructor)))
(actions (list (shepherd-configuration-action dicod.conf))))))) (actions (list (shepherd-configuration-action dicod.conf)))))))