GNU bug report logs - #74534
[shepherd] guix-home managed shepherd shares process group with shell

Previous Next

Package: guix;

Reported by: Jelle Licht <jlicht <at> fsfe.org>

Date: Mon, 25 Nov 2024 18:44:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#74534: closed ([shepherd] guix-home managed shepherd shares
 process group with shell)
Date: Thu, 28 Nov 2024 07:50:05 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 28 Nov 2024 08:48:34 +0100
with message-id <87ed2v94tp.fsf <at> gnu.org>
and subject line Re: bug#74534: [shepherd] guix-home managed shepherd shares process group with shell
has caused the debbugs.gnu.org bug report #74534,
regarding [shepherd] guix-home managed shepherd shares process group with shell
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
74534: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74534
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jelle Licht <jlicht <at> fsfe.org>
To: bug-guix <at> gnu.org
Cc: Tomas Volf <~@wolfsden.cz>,
 Ludovic Courtès <ludovic.courtes <at> inria.fr>
Subject: [shepherd] guix-home managed shepherd shares process group with shell
Date: Mon, 25 Nov 2024 19:42:55 +0100
Cc'ing Tomas and Ludo, as they actually diagnosed the issue [0].

The user shepherd, as configured using guix home, runs under the same
process group as the shell that initially triggered guix home's
"$HOME/.guix-home/on-first-login" script.

This leads to the user shepherd receiving signals that are sent to the
shell, such as a SIGINT/^C, and subsequently stopping entirely.

If I understand the fine folks on IRC correctly, the daemonize action of
the root-service in shepherd is missing a call to (setsid). I am
uncertain whether this setsid call should be made conditional or not.

Kind regards,
Jelle Licht

[0]: https://logs.guix.gnu.org/guix/2024-11-25.log#172506


[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: 74534-done <at> debbugs.gnu.org, Jelle Licht <jlicht <at> fsfe.org>
Subject: Re: bug#74534: [shepherd] guix-home managed shepherd shares process
 group with shell
Date: Thu, 28 Nov 2024 08:48:34 +0100
Hello!

Tomas Volf <~@wolfsden.cz> skribis:

> Jelle Licht <jlicht <at> fsfe.org> writes:
>
>> Addendum:
>> running `herd eval root "(setsid)"` solves my particular issue, making
>> ^C on my shell no longer kill my user shepherd.

Fixed in Shepherd commit 2b41e5bad65e783c7a9cc4d7a3f460cab6b64285.

> Oh, that is neat.  I did not realize this can be fixed like that without
> modifying shepherd's source code.  I turned it into a service that I
> added into my home-environment:
>
>      ;; Bug 74534: Home shepherd can be killed by ^C
>      (simple-service 'call-setsid-in-home-shepherd home-shepherd-service-type
>                      (list
>                       (shepherd-service
>                        (documentation "Give shepherd its own process group.")
>                        (provision '(setsid))
>                        (start #~(lambda _ (setsid) #t))
>                        (one-shot? #t))))

Nice workaound.

Thank you, comrades!

Ludo’.


This bug report was last modified 174 days ago.

Previous Next


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