* bug#60116: ‘herd stop guix-daemon’ doesn’t stop running sessions
@ 2022-12-16 11:12 Ludovic Courtès
0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2022-12-16 11:12 UTC (permalink / raw)
To: 60116
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’.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-16 11:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16 11:12 bug#60116: ‘herd stop guix-daemon’ doesn’t stop running sessions Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).