GNU bug report logs - #60116
‘herd stop guix-daemon’ doesn’t stop running sessions

Previous Next

Package: guix;

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

Date: Fri, 16 Dec 2022 11:13:02 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: bug-guix <at> gnu.org
Subject: ‘herd stop guix-daemon’ doesn’t stop running sessions
Date: Fri, 16 Dec 2022 12:12:06 +0100
Suppose you run a bunch of clients, ‘guix shell’, ‘guix build’,
whatever.  For each of these connections, guix-daemon creates a child
process to handle it.  (You can see them as “SessionPID” in the output
of ‘guix processes’.)

‘herd stop guix-daemon’ won’t stop these guix-daemon child processes,
only the parent process.

This is because those sub-processes put themselves in a separate process
group by calling ‘setsid’ (see ‘daemonLoop’ in ‘nix-daemon.cc’);
shepherd terminates the whole process group, but that group contains
nothing but the parent guix-daemon process.  I traced back this ‘setsid’
call to 2006 in Nix (Nix commit
0130ef88ea280e67037fa76bcedc59db17d9a8ca), but there’s no justification.

I would be tempted to just remove that ‘setsid’ call, but I wonder if
there’s something subtle I’m overlooking.

Thoughts?

Ludo’.




This bug report was last modified 2 years and 223 days ago.

Previous Next


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