services: dicod: Run in a container.
* gnu/services/dict.scm (dicod-shepherd-service): Add 'with-imported-modules' form and 'modules' field. Use 'make-forkexec-constructor/container' instead of 'make-forkexec-constructor'.
This commit is contained in:
parent
0cb9c9d170
commit
9e549ad1c3
|
@ -21,6 +21,7 @@
|
||||||
(define-module (gnu services dict)
|
(define-module (gnu services dict)
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:use-module (guix records)
|
#:use-module (guix records)
|
||||||
|
#:use-module (guix modules)
|
||||||
#:use-module (gnu services)
|
#:use-module (gnu services)
|
||||||
#:use-module (gnu services shepherd)
|
#:use-module (gnu services shepherd)
|
||||||
#:use-module (gnu system shadow)
|
#:use-module (gnu system shadow)
|
||||||
|
@ -144,14 +145,23 @@ database {
|
||||||
(let ((dicod (file-append (dicod-configuration-dico config)
|
(let ((dicod (file-append (dicod-configuration-dico config)
|
||||||
"/bin/dicod"))
|
"/bin/dicod"))
|
||||||
(dicod.conf (dicod-configuration-file config)))
|
(dicod.conf (dicod-configuration-file config)))
|
||||||
(list (shepherd-service
|
(with-imported-modules (source-module-closure
|
||||||
(provision '(dicod))
|
'((gnu build shepherd)
|
||||||
(documentation "Run the dicod daemon.")
|
(gnu system file-systems)))
|
||||||
(start #~(make-forkexec-constructor
|
(list (shepherd-service
|
||||||
(list #$dicod "--foreground"
|
(provision '(dicod))
|
||||||
(string-append "--config=" #$dicod.conf))
|
(documentation "Run the dicod daemon.")
|
||||||
#:user "dicod" #:group "dicod"))
|
(modules '((gnu build shepherd)
|
||||||
(stop #~(make-kill-destructor))))))
|
(gnu system file-systems)))
|
||||||
|
(start #~(make-forkexec-constructor/container
|
||||||
|
(list #$dicod "--foreground"
|
||||||
|
(string-append "--config=" #$dicod.conf))
|
||||||
|
#:user "dicod" #:group "dicod"
|
||||||
|
#:mappings (list (file-system-mapping
|
||||||
|
(source "/var/run/dicod")
|
||||||
|
(target source)
|
||||||
|
(writable? #t)))))
|
||||||
|
(stop #~(make-kill-destructor)))))))
|
||||||
|
|
||||||
(define dicod-service-type
|
(define dicod-service-type
|
||||||
(service-type
|
(service-type
|
||||||
|
|
Loading…
Reference in New Issue