[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#41507] [PATCH Shepherd 2/2] shepherd: Use 'signalfd' when possible.
From: |
Ludovic Courtès |
Subject: |
[bug#41507] [PATCH Shepherd 2/2] shepherd: Use 'signalfd' when possible. |
Date: |
Tue, 02 Jun 2020 23:38:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hi,
Mathieu Othacehe <othacehe@gnu.org> skribis:
>> That way, the child is guaranteed to never execute the original
>> handlers, and neither the parent nor the child misses any of these
>> signals (previously, the temporary (sigaction SIGTERM SIG_DFL)
>> introduced a window during which shepherd could be killed by a SIGTERM
>> instead of handling it gracefully.)
>>
>> WDYT?
>
> Yes, this is indeed much better this way!
>
>> +(define %precious-signals
>> + ;; Signals that the shepherd process handles.
>> + (list SIGCHLD SIGINT SIGHUP SIGTERM))
>
> We could maybe factorize this list with the one in "signal-port" in the
> "main" procedure. This way if we ever add an extra signal, we do not
> forget to add it to blocked signals list.
Yes, good idea.
I pushed the series with a followup commit to do that:
38e3589 shepherd: Factorize list of handled signals.
576ac61 service: 'fork+exec-command' blocks handled signals before forking.
ec36311 system: Add 'with-blocked-signals'.
bc74b5e system: 'sigprocmask' returns the previous set of blocked signals.
Let’s see if I can tag a release tomorrow…
Thanks for your feedback!
Ludo’.