mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
services: dicod: Use 'make-inetd-constructor'.
* gnu/services/dict.scm (dicod-shepherd-service): Use 'make-inetd-constructor' in the 'start' method when available.
This commit is contained in:
parent
002bcb7eb0
commit
fd57ce267c
1 changed files with 14 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue