From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 17:38:45 2020 Received: (at 41507) by debbugs.gnu.org; 2 Jun 2020 21:38:45 +0000 Received: from localhost ([127.0.0.1]:41155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgEcO-0004tk-Ot for submit@debbugs.gnu.org; Tue, 02 Jun 2020 17:38:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgEcN-0004tY-Rr for 41507@debbugs.gnu.org; Tue, 02 Jun 2020 17:38:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54407) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgEcI-0005Gj-Jw for 41507@debbugs.gnu.org; Tue, 02 Jun 2020 17:38:38 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39458 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jgEcH-00058y-EZ; Tue, 02 Jun 2020 17:38:37 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mathieu Othacehe Subject: Re: [bug#41507] [PATCH Shepherd 2/2] shepherd: Use 'signalfd' when possible. References: <20200524143700.6378-1-ludo@gnu.org> <20200524143700.6378-2-ludo@gnu.org> <87a71ww5zx.fsf@gnu.org> <87tuzxs4gj.fsf@gnu.org> <87imgax88r.fsf@gnu.org> Date: Tue, 02 Jun 2020 23:38:35 +0200 In-Reply-To: <87imgax88r.fsf@gnu.org> (Mathieu Othacehe's message of "Tue, 02 Jun 2020 09:00:20 +0200") Message-ID: <87h7vtrvvo.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41507 Cc: 41507@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: -3.3 (---) Hi, Mathieu Othacehe 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 forkin= g. ec36311 system: Add 'with-blocked-signals'. bc74b5e system: 'sigprocmask' returns the previous set of blocked signals. Let=E2=80=99s see if I can tag a release tomorrow=E2=80=A6 Thanks for your feedback! Ludo=E2=80=99.