From unknown Sat Jul 26 16:38:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#60116 <60116@debbugs.gnu.org> To: bug#60116 <60116@debbugs.gnu.org> Subject: Status: =?UTF-8?Q?=E2=80=98herd?= stop =?UTF-8?Q?guix-daemon=E2=80=99_?= =?UTF-8?Q?doesn=E2=80=99t?= stop running sessions Reply-To: bug#60116 <60116@debbugs.gnu.org> Date: Sat, 26 Jul 2025 23:38:30 +0000 retitle 60116 =E2=80=98herd stop guix-daemon=E2=80=99 doesn=E2=80=99t stop = running sessions reassign 60116 guix submitter 60116 Ludovic Court=C3=A8s severity 60116 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 16 06:12:13 2022 Received: (at submit) by debbugs.gnu.org; 16 Dec 2022 11:12:13 +0000 Received: from localhost ([127.0.0.1]:48629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p68dQ-0007Tw-Mf for submit@debbugs.gnu.org; Fri, 16 Dec 2022 06:12:12 -0500 Received: from lists.gnu.org ([209.51.188.17]:33104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p68dO-0007Tq-UF for submit@debbugs.gnu.org; Fri, 16 Dec 2022 06:12:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p68dO-0007KE-JR for bug-guix@gnu.org; Fri, 16 Dec 2022 06:12:10 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p68dN-00037J-UF for bug-guix@gnu.org; Fri, 16 Dec 2022 06:12:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=hn2SF5RFI4KpSDWGuAvdajT4MGZ2l6QGIouaktQD1+w=; b=IqouMwgin3wNSY Mf/ihAhVmEnt6pwBJsx8LkblOiUKyXesRt6fEJKprasA91rJBKIKg9d2WQHn1w6nuuMkGq37bUhqU nefOJUOjDrUywJ0S/84c51eSKvNVB/i8f4sXShMBSZPjtI2BIhnOQPOTG8BPP21p7AnEfT0vNtYrG InKzmMEuLxWK6QMmpqfYI/fgx+Gs8rA+HzDormh304v+IxIa8lsE1PvK8OixQTOdUDvDUnq16l1be ExHW96rkuoybmH2xwY63dQqhQKD2xiqyEZZ1Fp2SJ2iAQYrICHpQGoce2aEPwS1pBnl5c9D9UxQgt S8HSzxxpyH1DHn+I/5Ug==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p68dN-00043C-4Y for bug-guix@gnu.org; Fri, 16 Dec 2022 06:12:09 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guix@gnu.org Subject: =?utf-8?Q?=E2=80=98herd?= stop =?utf-8?Q?guix-daemon=E2=80=99_doe?= =?utf-8?Q?sn=E2=80=99t?= stop running sessions X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Sextidi 26 Frimaire an 231 de la =?utf-8?Q?R=C3=A9vo?= =?utf-8?Q?lution=2C?= jour du Pignon X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 16 Dec 2022 12:12:06 +0100 Message-ID: <877cyrk3g9.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Suppose you run a bunch of clients, =E2=80=98guix shell=E2=80=99, =E2=80=98= guix build=E2=80=99, whatever. For each of these connections, guix-daemon creates a child process to handle it. (You can see them as =E2=80=9CSessionPID=E2=80=9D in= the output of =E2=80=98guix processes=E2=80=99.) =E2=80=98herd stop guix-daemon=E2=80=99 won=E2=80=99t stop these guix-daemo= n child processes, only the parent process. This is because those sub-processes put themselves in a separate process group by calling =E2=80=98setsid=E2=80=99 (see =E2=80=98daemonLoop=E2=80=99= in =E2=80=98nix-daemon.cc=E2=80=99); shepherd terminates the whole process group, but that group contains nothing but the parent guix-daemon process. I traced back this =E2=80=98se= tsid=E2=80=99 call to 2006 in Nix (Nix commit 0130ef88ea280e67037fa76bcedc59db17d9a8ca), but there=E2=80=99s no justifica= tion. I would be tempted to just remove that =E2=80=98setsid=E2=80=99 call, but I= wonder if there=E2=80=99s something subtle I=E2=80=99m overlooking. Thoughts? Ludo=E2=80=99.