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