unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 60116@debbugs.gnu.org
Subject: bug#60116: ‘herd stop guix-daemon’ doesn’t stop running sessions
Date: Fri, 16 Dec 2022 12:12:06 +0100	[thread overview]
Message-ID: <877cyrk3g9.fsf@inria.fr> (raw)

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’.




                 reply	other threads:[~2022-12-16 11:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cyrk3g9.fsf@inria.fr \
    --to=ludo@gnu.org \
    --cc=60116@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).