all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#74534: [shepherd] guix-home managed shepherd shares process group with shell
@ 2024-11-25 18:42 Jelle Licht
  2024-11-25 18:52 ` Jelle Licht
  0 siblings, 1 reply; 3+ messages in thread
From: Jelle Licht @ 2024-11-25 18:42 UTC (permalink / raw)
  To: 74534; +Cc: Tomas Volf, Ludovic Courtès


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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#74534: [shepherd] guix-home managed shepherd shares process group with shell
  2024-11-25 18:42 bug#74534: [shepherd] guix-home managed shepherd shares process group with shell Jelle Licht
@ 2024-11-25 18:52 ` Jelle Licht
  2024-11-25 20:26   ` Tomas Volf
  0 siblings, 1 reply; 3+ messages in thread
From: Jelle Licht @ 2024-11-25 18:52 UTC (permalink / raw)
  To: 74534; +Cc: Tomas Volf, Ludovic Courtès


Jelle Licht <jlicht@fsfe.org> writes:

> 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

Addendum:
running `herd eval root "(setsid)"` solves my particular issue, making
^C on my shell no longer kill my user shepherd.

- Jelle




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#74534: [shepherd] guix-home managed shepherd shares process group with shell
  2024-11-25 18:52 ` Jelle Licht
@ 2024-11-25 20:26   ` Tomas Volf
  0 siblings, 0 replies; 3+ messages in thread
From: Tomas Volf @ 2024-11-25 20:26 UTC (permalink / raw)
  To: Jelle Licht; +Cc: 74534, Ludovic Courtès

[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]


Hello,

thank you for CC-ing me.

Jelle Licht <jlicht@fsfe.org> writes:

> Addendum:
> running `herd eval root "(setsid)"` solves my particular issue, making
> ^C on my shell no longer kill my user shepherd.

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:

--8<---------------cut here---------------start------------->8---
     ;; 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))))
--8<---------------cut here---------------end--------------->8---

Have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-25 20:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-25 18:42 bug#74534: [shepherd] guix-home managed shepherd shares process group with shell Jelle Licht
2024-11-25 18:52 ` Jelle Licht
2024-11-25 20:26   ` Tomas Volf

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.