From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 12 18:40:29 2018 Received: (at 32128-done) by debbugs.gnu.org; 12 Jul 2018 22:40:29 +0000 Received: from localhost ([127.0.0.1]:57513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdkGD-0001zq-5z for submit@debbugs.gnu.org; Thu, 12 Jul 2018 18:40:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdkGB-0001ze-Nt for 32128-done@debbugs.gnu.org; Thu, 12 Jul 2018 18:40:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdkG5-0000gt-Au for 32128-done@debbugs.gnu.org; Thu, 12 Jul 2018 18:40:22 -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_40 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdkG5-0000gm-0q; Thu, 12 Jul 2018 18:40:21 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45438 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fdkG4-0003Ln-KM; Thu, 12 Jul 2018 18:40:20 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: [bug#32128] [PATCH 0/2] Support custom actions for Shepherd services References: <20180711214717.29955-1-ludo@gnu.org> <87601k38td.fsf@lassieur.org> Date: Fri, 13 Jul 2018 00:40:18 +0200 In-Reply-To: <87601k38td.fsf@lassieur.org> (=?utf-8?Q?=22Cl=C3=A9ment?= Lassieur"'s message of "Thu, 12 Jul 2018 15:03:26 +0200") Message-ID: <871sc8qdrh.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: 32128-done Cc: 32128-done@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 Cl=C3=A9ment, Cl=C3=A9ment Lassieur skribis: > Ludovic Court=C3=A8s writes: > >> Hello Guix! >> >> This is a long-awaited feature=E2=80=94nothing fancy, but it can certain= ly be >> useful as illustrated by the =E2=80=98herd schedule mcron=E2=80=99 examp= le below. >> >> I suppose we can add actions for hot-swapping and reconfiguration of >> services that support it, such as nginx: . > > This is fantastic! Thank you :-) And it looks good to me. Thanks! I=E2=80=99ve pushed it. > A few notes though (more about the Shepherd): > > - It would be great to be able to use actions even when services are not > started. In the case of the "mcron" service, for example, it makes > sense: one may not want to risk spawning a program while wanting to > debug the schedule. Indeed, I think this restriction should be waived, and this comment from ca. 2003 in shepherd/service.scm suggests it=E2=80=99s unfounded: ;; Calling default-action will be allowed even when the service is ;; not running, as it provides generally useful functionality and ;; information. ;; FIXME: Why should the user-implementations not be allowed to be ;; called this way? Done in Shepherd commit 5ab8cbc9bcfce586a5389ad95a65f011d02bd289. > - It seems that sometimes the SIGCHLD handler is invoked, when the > 'running' field is not yet set. Should CALL-WITH-BLOCKED-ASYNCS be > used? As discussed on IRC, the error we were getting when doing things like =E2=80=9Cherd schedule mcron 50=E2=80=9D (=E2=80=9Cwaitpid: No child proces= ses=E2=80=9D), came from the fact that =E2=80=98close-pipe=E2=80=99 invokes =E2=80=98waitpid=E2=80=99, b= ut there=E2=80=99s a race with the Shepherd=E2=80=99s SIGCHLD handler, which might get to call =E2=80=98waitpi= d=E2=80=99 earlier. I=E2=80=99ve adjusted to code to protect against it but without blocking as= yncs, which seems safer. Thank you! Ludo=E2=80=99.