From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdkGl-0003SD-Tp for guix-patches@gnu.org; Thu, 12 Jul 2018 18:41:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdkGl-0001Ai-0Y for guix-patches@gnu.org; Thu, 12 Jul 2018 18:41:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:49617) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fdkGk-0001AQ-S5 for guix-patches@gnu.org; Thu, 12 Jul 2018 18:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fdkGk-00020z-LY for guix-patches@gnu.org; Thu, 12 Jul 2018 18:41:02 -0400 Subject: bug#32128: [PATCH 0/2] Support custom actions for Shepherd services Resent-To: guix-patches@gnu.org Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) 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?Cl=C3=A9ment?= Lassieur"'s message of "Thu, 12 Jul 2018 15:03:26 +0200") Message-ID: <871sc8qdrh.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 32128-done@debbugs.gnu.org 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.