From 7d91bd453010da8941f32694706024645905ae37 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi via Guix-patches via Date: Tue, 11 Jun 2024 22:04:58 +0200 Subject: services: oci-container: Allow setting Shepherd auto-start? in oci-container-configuration. * gnu/services/docker.scm (oci-container-configuration) [auto-start?]: New field. (oci-container-shepherd-service): use it. * doc/guix.texi: Document it. Change-Id: Id093d93effbbec3e1be757f8be83cf5f62eaeda7 Signed-off-by: Zheng Junjie --- gnu/services/docker.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gnu') diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm index c256d1601b..a247fba8b8 100644 --- a/gnu/services/docker.scm +++ b/gnu/services/docker.scm @@ -75,6 +75,7 @@ oci-container-configuration-provision oci-container-configuration-requirement oci-container-configuration-log-file + oci-container-configuration-auto-start? oci-container-configuration-network oci-container-configuration-ports oci-container-configuration-volumes @@ -467,6 +468,10 @@ service.") "When @code{log-file} is set, it names the file to which the service’s standard output and standard error are redirected. @code{log-file} is created if it does not exist, otherwise it is appended to.") + (auto-start? + (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}.") (network (maybe-string) "Set a Docker network for the spawned container.") @@ -670,6 +675,8 @@ operating-system, gexp or file-like records but ~a was found") (oci-image-repository image)))))) (let* ((docker (file-append docker-cli "/bin/docker")) + (auto-start? + (oci-container-configuration-auto-start? config)) (user (oci-container-configuration-user config)) (group (oci-container-configuration-group config)) (host-environment @@ -688,6 +695,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) + (auto-start? auto-start?) (documentation (string-append "Docker backed Shepherd service for " -- cgit v1.2.3