‘herd stop guix-daemon’ doesn’t stop running sessions

  • Open
  • quality assurance status badge
Details
One participant
  • Ludovic Courtès
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal

Debbugs page

Ludovic Courtès wrote 2 years ago
‘herd stop guix-daemon’ doe sn’t stop running sessions
(address . bug-guix@gnu.org)
877cyrk3g9.fsf@inria.fr
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’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 60116@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 60116
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help