all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Clément Lassieur" <clement@lassieur.org>
Cc: 32128-done@debbugs.gnu.org
Subject: bug#32128: [PATCH 0/2] Support custom actions for Shepherd services
Date: Fri, 13 Jul 2018 00:40:18 +0200	[thread overview]
Message-ID: <871sc8qdrh.fsf@gnu.org> (raw)
In-Reply-To: <87601k38td.fsf@lassieur.org> ("Clément Lassieur"'s message of "Thu, 12 Jul 2018 15:03:26 +0200")

Hello Clément,

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

> Ludovic Courtès <ludo@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’.

      reply	other threads:[~2018-07-12 22:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 21:47 [bug#32128] [PATCH 0/2] Support custom actions for Shepherd services Ludovic Courtès
2018-07-11 21:55 ` [bug#32128] [PATCH 1/2] services: shepherd: Support custom actions Ludovic Courtès
2018-07-11 21:55   ` [bug#32128] [PATCH 2/2] services: mcron: Add 'schedule' action Ludovic Courtès
2018-07-12 13:03 ` [bug#32128] [PATCH 0/2] Support custom actions for Shepherd services Clément Lassieur
2018-07-12 22:40   ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871sc8qdrh.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=32128-done@debbugs.gnu.org \
    --cc=clement@lassieur.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.