aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorGiacomo Leidi via Guix-patches via <guix-patches@gnu.org>2024-06-11 22:04:59 +0200
committerZheng Junjie <zhengjunjie@iscas.ac.cn>2024-07-05 15:12:34 +0800
commitcb57a3fd9f09f4158f1e2ff122ac855be422f374 (patch)
treed80dc0de55e83bfa1367b6c2e2b4b23468efc6f3 /gnu/services
parent7d91bd453010da8941f32694706024645905ae37 (diff)
downloadguix-cb57a3fd9f09f4158f1e2ff122ac855be422f374.tar
guix-cb57a3fd9f09f4158f1e2ff122ac855be422f374.tar.gz
services: oci-container: Allow setting Shepherd respawn? in oci-container-configuration.
* gnu/services/docker.scm (oci-container-configuration) [respawn?]: New field. (oci-container-shepherd-service): use it. * doc/guix.texi: Document it. Change-Id: I0d6367607fd0fd41f90a54b33d80bf4d4f43dd8b Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn>
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/docker.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm
index a247fba8b8..f77e348b81 100644
--- a/gnu/services/docker.scm
+++ b/gnu/services/docker.scm
@@ -76,6 +76,7 @@
oci-container-configuration-requirement
oci-container-configuration-log-file
oci-container-configuration-auto-start?
+ oci-container-configuration-respawn?
oci-container-configuration-network
oci-container-configuration-ports
oci-container-configuration-volumes
@@ -472,6 +473,10 @@ if it does not exist, otherwise it is appended to.")
(boolean #t)
"Whether this service should be started automatically by the Shepherd. If it
is @code{#f} the service has to be started manually with @command{herd start}.")
+ (respawn?
+ (boolean #f)
+ "Whether to restart the service when it stops, for instance when the
+underlying process dies.")
(network
(maybe-string)
"Set a Docker network for the spawned container.")
@@ -685,6 +690,8 @@ operating-system, gexp or file-like records but ~a was found")
(log-file (oci-container-configuration-log-file config))
(provision (oci-container-configuration-provision config))
(requirement (oci-container-configuration-requirement config))
+ (respawn?
+ (oci-container-configuration-respawn? config))
(image (oci-container-configuration-image config))
(image-reference (oci-image-reference image))
(options (oci-container-configuration->options config))
@@ -694,7 +701,7 @@ operating-system, gexp or file-like records but ~a was found")
(shepherd-service (provision `(,(string->symbol name)))
(requirement `(dockerd user-processes ,@requirement))
- (respawn? #f)
+ (respawn? respawn?)
(auto-start? auto-start?)
(documentation
(string-append