me
/
guix
Archived
1
0
Fork 0

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>
master
Giacomo Leidi via Guix-patches via 2024-06-11 22:04:59 +02:00 committed by Zheng Junjie
parent 7d91bd4530
commit cb57a3fd9f
No known key found for this signature in database
GPG Key ID: 3B5AA993E1A2DFF0
2 changed files with 12 additions and 1 deletions

View File

@ -40894,6 +40894,10 @@ if it does not exist, otherwise it is appended to.
Whether this service should be started automatically by the Shepherd. If it 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}. is @code{#f} the service has to be started manually with @command{herd start}.
@item @code{respawn?} (default: @code{#f}) (type: boolean)
Whether to have Shepherd restart the service when it stops, for instance when
the underlying process dies.
@item @code{network} (default: @code{""}) (type: string) @item @code{network} (default: @code{""}) (type: string)
Set a Docker network for the spawned container. Set a Docker network for the spawned container.

View File

@ -76,6 +76,7 @@
oci-container-configuration-requirement oci-container-configuration-requirement
oci-container-configuration-log-file oci-container-configuration-log-file
oci-container-configuration-auto-start? oci-container-configuration-auto-start?
oci-container-configuration-respawn?
oci-container-configuration-network oci-container-configuration-network
oci-container-configuration-ports oci-container-configuration-ports
oci-container-configuration-volumes oci-container-configuration-volumes
@ -472,6 +473,10 @@ if it does not exist, otherwise it is appended to.")
(boolean #t) (boolean #t)
"Whether this service should be started automatically by the Shepherd. If it "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}.") 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 (network
(maybe-string) (maybe-string)
"Set a Docker network for the spawned container.") "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)) (log-file (oci-container-configuration-log-file config))
(provision (oci-container-configuration-provision config)) (provision (oci-container-configuration-provision config))
(requirement (oci-container-configuration-requirement config)) (requirement (oci-container-configuration-requirement config))
(respawn?
(oci-container-configuration-respawn? config))
(image (oci-container-configuration-image config)) (image (oci-container-configuration-image config))
(image-reference (oci-image-reference image)) (image-reference (oci-image-reference image))
(options (oci-container-configuration->options config)) (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))) (shepherd-service (provision `(,(string->symbol name)))
(requirement `(dockerd user-processes ,@requirement)) (requirement `(dockerd user-processes ,@requirement))
(respawn? #f) (respawn? respawn?)
(auto-start? auto-start?) (auto-start? auto-start?)
(documentation (documentation
(string-append (string-append