From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 25 10:20:25 2018 Received: (at 32408) by debbugs.gnu.org; 25 Aug 2018 14:20:25 +0000 Received: from localhost ([127.0.0.1]:60698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftZQP-0003Br-JJ for submit@debbugs.gnu.org; Sat, 25 Aug 2018 10:20:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftZQN-0003Bc-SP for 32408@debbugs.gnu.org; Sat, 25 Aug 2018 10:20:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ftZQH-0000Cr-Q7 for 32408@debbugs.gnu.org; Sat, 25 Aug 2018 10:20:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftZQH-0000Cf-Mn; Sat, 25 Aug 2018 10:20:17 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43998 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ftZQH-0005lA-Br; Sat, 25 Aug 2018 10:20:17 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Carlo Zancanaro Subject: Re: [bug#32408] [PATCH shepherd] Allow replacement of services References: <87wosz4spx.fsf@zancanaro.id.au> <87h8jobwwp.fsf@gnu.org> <87k1okzqkf.fsf@zancanaro.id.au> <87in44ovzm.fsf@gnu.org> <87o9dtqjry.fsf@zancanaro.id.au> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 8 Fructidor an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 25 Aug 2018 16:20:15 +0200 In-Reply-To: <87o9dtqjry.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Thu, 23 Aug 2018 23:45:05 +1000") Message-ID: <877ekecyu8.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32408 Cc: 32408@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hello! Carlo Zancanaro skribis: > I've attached an updated patch. I couldn't think of any unwanted > consequences, so I took your idea of making register-services handle > most of the details of replacement. With my patch, something like >> herd eval root '(register-services (load "a.scm") (load >> "b.scm"))' > will deal with a conflict by either replacing the old service (if it's > not running), arranging for the old service to be replaced when it's > stopped, or raising an error. This seems like a sensible way for > things to function. Awesome. Thus, the only thing we need to change in =E2=80=98guix system reconfigure=E2=80=99 is to make the =E2=80=98register-services=E2=80=99 cal= l unconditional (currently it=E2=80=99s limited to services that are stopped.) > Despite my desire to deal with the race condition, I haven't done > anything about it in this patch. The modification of %services that > was done in register-services was already racy, and I don't think this > patch will make it worse. If it hasn't been a problem up until now, > then I don't think this will make it a problem. Yeah, sounds reasonable. > From 9ec5c0000e9a45441417a6ee4138cdcbf1b1f2b2 Mon Sep 17 00:00:00 2001 > From: Carlo Zancanaro > Date: Thu, 9 Aug 2018 22:30:38 +1000 > Subject: [PATCH] service: Add a replacement slot for delayed service > replacement. > > * modules/shepherd/service.scm (): Add replacement slot > (replace-service): New procedure. > (stop): Call replace-service after stopping a service. > (register-services): Replace existing services where possible, setting th= e new > replacement slot if they are currently running. > * tests/replacement.sh: Add a test for it. > * Makefile.am (TESTS): Add the new test. > * doc/shepherd.texi (Slots of services): Document it. Awesome, please push! And sorry about the delay. Thank you, Ludo=E2=80=99.