mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
services: cuirass: Socket activation for ‘cuirass register’.
Fixes guix/cuirass#16. * gnu/services/cuirass.scm (cuirass-shepherd-service)[endpoint]: New procedure. Use ‘make-systemd-constructor’ for ‘cuirass register’. Set the ‘COLUMNS’ environment variable. Change-Id: If58e4e8a889ab11e4b5b89a7abaf0af24600751b
This commit is contained in:
parent
f3cc235bfc
commit
577f8fe184
1 changed files with 15 additions and 2 deletions
|
@ -130,6 +130,14 @@
|
||||||
|
|
||||||
(define (cuirass-shepherd-service config)
|
(define (cuirass-shepherd-service config)
|
||||||
"Return a <shepherd-service> for the Cuirass service with CONFIG."
|
"Return a <shepherd-service> for the Cuirass service with CONFIG."
|
||||||
|
(define (endpoint name)
|
||||||
|
#~(endpoint (make-socket-address AF_UNIX
|
||||||
|
#$(in-vicinity "/var/run/cuirass" name))
|
||||||
|
#:name #$name
|
||||||
|
#:socket-owner #$(cuirass-configuration-user config)
|
||||||
|
#:socket-group #$(cuirass-configuration-group config)
|
||||||
|
#:socket-directory-permissions #o700))
|
||||||
|
|
||||||
(let ((cuirass (cuirass-configuration-cuirass config))
|
(let ((cuirass (cuirass-configuration-cuirass config))
|
||||||
(cache-directory (cuirass-configuration-cache-directory config))
|
(cache-directory (cuirass-configuration-cache-directory config))
|
||||||
(web-log-file (cuirass-configuration-web-log-file config))
|
(web-log-file (cuirass-configuration-web-log-file config))
|
||||||
|
@ -158,7 +166,7 @@
|
||||||
(requirement '(user-processes
|
(requirement '(user-processes
|
||||||
guix-daemon
|
guix-daemon
|
||||||
postgres postgres-roles networking))
|
postgres postgres-roles networking))
|
||||||
(start #~(make-forkexec-constructor
|
(start #~(make-systemd-constructor
|
||||||
(list (string-append #$cuirass "/bin/cuirass")
|
(list (string-append #$cuirass "/bin/cuirass")
|
||||||
"register"
|
"register"
|
||||||
"--cache-directory" #$cache-directory
|
"--cache-directory" #$cache-directory
|
||||||
|
@ -191,16 +199,21 @@
|
||||||
#$@(if fallback? '("--fallback") '())
|
#$@(if fallback? '("--fallback") '())
|
||||||
#$@extra-options)
|
#$@extra-options)
|
||||||
|
|
||||||
|
;; Unix-domain sockets that trigger socket activation.
|
||||||
|
(list #$(endpoint "bridge")
|
||||||
|
#$(endpoint "remote-builds"))
|
||||||
|
|
||||||
#:environment-variables
|
#:environment-variables
|
||||||
(list "LC_ALL=C.UTF-8" ;for proper file name decoding
|
(list "LC_ALL=C.UTF-8" ;for proper file name decoding
|
||||||
"GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt"
|
"GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt"
|
||||||
|
"COLUMNS=200" ;for backtraces
|
||||||
(string-append "GIT_EXEC_PATH=" #$git
|
(string-append "GIT_EXEC_PATH=" #$git
|
||||||
"/libexec/git-core"))
|
"/libexec/git-core"))
|
||||||
|
|
||||||
#:user #$user
|
#:user #$user
|
||||||
#:group #$group
|
#:group #$group
|
||||||
#:log-file #$main-log-file))
|
#:log-file #$main-log-file))
|
||||||
(stop #~(make-kill-destructor))
|
(stop #~(make-systemd-destructor))
|
||||||
(actions (list (shepherd-configuration-action config-file))))
|
(actions (list (shepherd-configuration-action config-file))))
|
||||||
,(shepherd-service
|
,(shepherd-service
|
||||||
(documentation "Run Cuirass web interface.")
|
(documentation "Run Cuirass web interface.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue