From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id EF5LLcigV2Z/HAEAA41jLg (envelope-from ) for ; Wed, 29 May 2024 23:40:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id yA6NKMigV2a/2AAA62LTzQ (envelope-from ) for ; Wed, 29 May 2024 23:40:24 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=TD1QzZ4Q; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1717018824; a=rsa-sha256; cv=none; b=BTpfMEbExu0ffrieLRRLXeNJtqVb/TUJA5YGFCCUC5jh+FPbBRYotS3OVQWAO57sE8vOAX +YPGtm6d533HB6FZgVQz8RDWGh7a0IV4klDcymc8ZInQmzK5ZH98HwFeNAW7PzgrrG486a YnnEAR/NnBDJIv53JWuTLjR0MzJvm/gy/A1jpHXVJD1nh+dg5kB5z/upy17HBmWwugiKtL V4Mcv6cZ1CcJLkd8mbOuZYpO83Ge78Rjj2E/DrHEQagnAPMt3MkKFNC21GAUPe3efA0FZr o/lkHr4SEOWM2Ld53Gk/o7GbnugLWYe3OSHErH8Qv6vJwFeBCq8DEPY3zEMENw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=TD1QzZ4Q; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1717018824; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=KPj89O7qluay/kshsG9dzmlaK4UL0JIfkYp9fhs98C4=; b=jqOtSiCf7tGVFL28/qoGHnxvu0jfvRh3yePNYzJZ4c2dbEpGz3dF3AiDLa0KnZbkhNaf0V kNs0ae+lKTQVmIUvxgs6gBYNzALAB9VICZgxW4VBP16hl3FUVgQq/DQ9HjmsbwaLDwp/5h RtHwxTL8CWY/hZB++HPcYbOliZm9wJ4Q8FzqMbM5iXq0gOEHgRARvDwkH1D9HTCoTe4TOG Q3V+9m2QO4gVHV5yAOwWxQfPvtMRLF/IkgCEpZZhABYoXOkQyO5Sh387OqYG84Aef+miuq J8SfAbWDPIlQ3jDLysOWOXAibK8OvoL0E8oW0JcWrHTubFq7b+d0o8ONGyCqBg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 823D066553 for ; Wed, 29 May 2024 23:40:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCR1Z-0000o4-14; Wed, 29 May 2024 17:39:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCR1X-0000n1-3c for guix-patches@gnu.org; Wed, 29 May 2024 17:39:55 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCR1W-0001oV-R6; Wed, 29 May 2024 17:39:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCR1g-0008DX-Hv; Wed, 29 May 2024 17:40:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71263] [PATCH 3/5] gnu: docker: Allow setting Shepherd auto-start? in oci-container-configuration. Resent-From: Giacomo Leidi Original-Sender: "Debbugs-submit" Resent-CC: pelzflorian@pelzflorian.de, ludo@gnu.org, matt@excalamus.com, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Wed, 29 May 2024 21:40:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71263 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 71263@debbugs.gnu.org Cc: Giacomo Leidi , Florian Pelz , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Matthew Trzcinski , Maxim Cournoyer X-Debbugs-Original-Xcc: Florian Pelz , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Matthew Trzcinski , Maxim Cournoyer Received: via spool by 71263-submit@debbugs.gnu.org id=B71263.171701877731462 (code B ref 71263); Wed, 29 May 2024 21:40:04 +0000 Received: (at 71263) by debbugs.gnu.org; 29 May 2024 21:39:37 +0000 Received: from localhost ([127.0.0.1]:55973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCR1E-0008BN-E0 for submit@debbugs.gnu.org; Wed, 29 May 2024 17:39:36 -0400 Received: from confino.investici.org ([93.190.126.19]:55747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCR18-0008Ad-NQ for 71263@debbugs.gnu.org; Wed, 29 May 2024 17:39:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1717018752; bh=KPj89O7qluay/kshsG9dzmlaK4UL0JIfkYp9fhs98C4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TD1QzZ4QPHDklMJQYb/qufPJ0lttV55yAV0kMyLFf1wb0Rb5/rgg8uP1Y7Cq7yDPP 3S2R5WVqOqM2jxa5SRuJd5mnJSUMWkPQa+4aMNEPQPLRYWXGsIaNpcIQU4m9eyBOsz azuaotXfjgWKjDQG+nBo/33g0oX1z7z4QKvmPUl8= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4VqN7N65fPz1113; Wed, 29 May 2024 21:39:12 +0000 (UTC) Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4VqN7N5c2qz110x; Wed, 29 May 2024 21:39:12 +0000 (UTC) Date: Wed, 29 May 2024 23:38:54 +0200 Message-ID: <599079e06b2d086978ec21a1179f477c5497fc78.1717018736.git.goodoldpaul@autistici.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <31ff6a93a8c7b50e5152f75b091b28851d5c4cc8.1717018735.git.goodoldpaul@autistici.org> References: <31ff6a93a8c7b50e5152f75b091b28851d5c4cc8.1717018735.git.goodoldpaul@autistici.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Giacomo Leidi X-ACL-Warn: , Giacomo Leidi via Guix-patches From: Giacomo Leidi via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 823D066553 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.45 X-Spam-Score: -5.45 X-TUID: DxIQuj7v/tY2 * gnu/services/docker.scm (oci-container-configuration) [auto-start?]: New field; (oci-container-shepherd-service): use it. Change-Id: Id093d93effbbec3e1be757f8be83cf5f62eaeda7 --- doc/guix.texi | 4 ++++ gnu/services/docker.scm | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 954196b14c..dfc4d65349 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -40649,6 +40649,10 @@ Miscellaneous Services standard output and standard error are redirected. @code{log-file} is created if it does not exist, otherwise it is appended to. +@item @code{auto-start?} (default: @code{#t}) (type: boolean) +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}. + @item @code{network} (default: @code{""}) (type: string) Set a Docker network for the spawned container. diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm index 678e8b1139..712ca14cba 100644 --- a/gnu/services/docker.scm +++ b/gnu/services/docker.scm @@ -75,6 +75,7 @@ (define-module (gnu services docker) 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 @@ (define-configuration/no-serialization oci-container-configuration "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 @@ (define (oci-container-shepherd-service config) (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 @@ -691,6 +698,7 @@ (define (oci-container-shepherd-service config) (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 " -- 2.41.0