GNU bug report logs - #27553
[PATCH shepherd] Register SIGCHLD handler after primitive fork

Previous Next

Package: guix-patches;

Reported by: Jelle Licht <jlicht <at> fsfe.org>

Date: Sun, 2 Jul 2017 01:12:01 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: Jelle Licht <jlicht <at> fsfe.org>
Subject: bug#27553: closed (Re: [bug#27553] [PATCH shepherd] Register
 SIGCHLD handler after primitive fork)
Date: Thu, 07 Sep 2017 14:50:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#27553: [PATCH shepherd] Register SIGCHLD handler after primitive fork

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 27553 <at> debbugs.gnu.org.

-- 
27553: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=27553
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: ludo <at> gnu.org (Ludovic Courtès)
To: Jelle Licht <jlicht <at> fsfe.org>
Cc: 27553-done <at> debbugs.gnu.org
Subject: Re: [bug#27553] [PATCH shepherd] Register SIGCHLD handler after
 primitive fork
Date: Thu, 07 Sep 2017 16:49:36 +0200
Heya!

Jelle Licht <jlicht <at> fsfe.org> skribis:

> I just tested what Ludo' proposed, and it seems to work like a charm.
> Seeing as we might be seeing more non-init shepherd instances w.r.t.
>  user services and the possible service extension to `guix environment',
> I think it would be a good call to fix this bug :-).

Indeed, thanks for the reminder.

> From db942182224dfc0accad94897dd2122b128eef07 Mon Sep 17 00:00:00 2001
> From: Jelle Licht <jlicht <at> fsfe.org>
> Date: Thu, 7 Sep 2017 00:52:49 +0200
> Subject: [PATCH] Lazily register SIGCHLD hander on first call to
>  'fork+exec-command'.
>
> * modules/shepherd.scm (main): Move unconditional top-level call to 'sigaction' to...
> * modules/shepherd/service.scm (fork+exec-command): here. Use new variable.
> (%sigchld-handler-installed?): New variable.

LGTM, applied!

Ludo’.

[Message part 3 (message/rfc822, inline)]
From: Jelle Licht <jlicht <at> fsfe.org>
To: guix-patches <at> gnu.org
Subject: [PATCH shepherd] Register SIGCHLD handler after primitive fork
Date: Sun, 2 Jul 2017 03:11:01 +0200
[Message part 4 (text/plain, inline)]
Hi all,

I am not sure if this is also the proper ML for the GNU Shepherd, but
looking in the archives lead me to believe it actually is. If not, I
suggest the gnu.org page for shepherd be updated with the correct info.

I recently starting playing around with user shepherd, and found out that
when running a shepherd 0.3.2 daemonized as non-init process (via "(action
'shepherd 'daemonize)"), zombie processes are created whenever you start
and subsequently stop any service.

Thinking I did something wrong, I asked lfam on #guix to share his (very
helpful) init.scm for user shepherd, yet I still noticed the same behaviour.

I believe commit `efa2f45c5f7dc735407381b7b8a83d6c37f828db' inadvertently
introduced an ordering issue, where the SIGCHLD handler is registered
/before/ shepherd has the chance to daemonize. I believe the following
trivial patch addresses this snafu.

Regards,
Jelle
[Message part 5 (text/html, inline)]
[0001-Register-SIGCHLD-handler-after-primitive-fork.patch (text/x-patch, attachment)]

This bug report was last modified 7 years and 319 days ago.

Previous Next


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