Subject: bug#74534: closed (Re: bug#74534: [shepherd] guix-home managed shepherd shares process group with shell)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 28 Nov 2024 07:50:06 +0000

Your bug report

#74534: [shepherd] guix-home managed shepherd shares process group with shell

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74534: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74534
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#74534: [shepherd] guix-home managed shepherd shares process group with shell
From: Ludovic Courtès <[email-masked]>
To: Tomas Volf <[email-masked]>
Cc: [email-masked], Jelle Licht <[email-masked]>
Date: Thu, 28 Nov 2024 08:48:34 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello!

Tomas Volf <[email-masked]> skribis:

> Jelle Licht <[email-masked]> 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’.

Subject: [shepherd] guix-home managed shepherd shares process group with shell
From: Jelle Licht <[email-masked]>
To: [email-masked]
Cc: Tomas Volf <[email-masked]>, Ludovic Courtès <[email-masked]>
Date: Mon, 25 Nov 2024 19:42:55 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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