GNU bug report logs - #32128
[PATCH 0/2] Support custom actions for Shepherd services

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Wed, 11 Jul 2018 21:48:02 UTC

Severity: normal

Tags: patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: tracker <at> debbugs.gnu.org
Subject: bug#32128: closed ([PATCH 0/2] Support custom actions for
 Shepherd services)
Date: Thu, 12 Jul 2018 22:41:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 13 Jul 2018 00:40:18 +0200
with message-id <871sc8qdrh.fsf <at> gnu.org>
and subject line Re: [bug#32128] [PATCH 0/2] Support custom actions for Shepherd services
has caused the debbugs.gnu.org bug report #32128,
regarding [PATCH 0/2] Support custom actions for Shepherd services
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
32128: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32128
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 0/2] Support custom actions for Shepherd services
Date: Wed, 11 Jul 2018 23:47:17 +0200
Hello Guix!

This is a long-awaited feature—nothing fancy, but it can certainly be
useful as illustrated by the ‘herd schedule mcron’ example below.

I suppose we can add actions for hot-swapping and reconfiguration of
services that support it, such as nginx: <https://bugs.gnu.org/26830>.

Feedback welcome!

Ludo’.

Ludovic Courtès (2):
  services: shepherd: Support custom actions.
  services: mcron: Add 'schedule' action.

 doc/guix.texi             | 74 +++++++++++++++++++++++++++++++++++++++
 gnu/services/herd.scm     |  3 ++
 gnu/services/mcron.scm    | 67 ++++++++++++++++++++++++++---------
 gnu/services/shepherd.scm | 23 +++++++++++-
 gnu/tests/base.scm        |  7 ++++
 5 files changed, 156 insertions(+), 18 deletions(-)

-- 
2.18.0



[Message part 3 (message/rfc822, inline)]
From: ludo <at> gnu.org (Ludovic Courtès)
To: Clément Lassieur <clement <at> lassieur.org>
Cc: 32128-done <at> debbugs.gnu.org
Subject: Re: [bug#32128] [PATCH 0/2] Support custom actions for Shepherd
 services
Date: Fri, 13 Jul 2018 00:40:18 +0200
Hello Clément,

Clément Lassieur <clement <at> lassieur.org> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Hello Guix!
>>
>> This is a long-awaited feature—nothing fancy, but it can certainly be
>> useful as illustrated by the ‘herd schedule mcron’ example below.
>>
>> I suppose we can add actions for hot-swapping and reconfiguration of
>> services that support it, such as nginx: <https://bugs.gnu.org/26830>.
>
> This is fantastic!  Thank you :-)  And it looks good to me.

Thanks!  I’ve 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’s 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
“herd schedule mcron 50” (“waitpid: No child processes”), came from the
fact that ‘close-pipe’ invokes ‘waitpid’, but there’s a race with the
Shepherd’s SIGCHLD handler, which might get to call ‘waitpid’ earlier.

I’ve adjusted to code to protect against it but without blocking asyncs,
which seems safer.

Thank you!

Ludo’.


This bug report was last modified 6 years and 345 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.