Subject: bug#40981: Graphical installer tests sometimes hang.

From: Mathieu Othacehe <[email-masked]>
Date: Mon, 04 May 2020 14:50:43 +0200

> I'll keep looking!

Ok, getting closer. Here's a suspect part of Shepherd strace log:

--8<---------------cut here---------------start------------->8---
[pid     1] stat("/etc/localtime", {st_mode=S_IFREG|0444, st_size=2298, ...}) = 0
[pid     1] write(9, "shepherd[1]: changing HTTP/HTTPS"..., 86) = 86
[pid     1] getpgid(194)                = 194
[pid     1] kill(-194, SIGTERM)         = 0
--8<---------------cut here---------------end--------------->8---

I think the problem is introduced by commit
1e7a91d21f1cc5d02697680e19e3878ff8565710 in Shepherd.

"(getpgid <guix-daemon-pid>") returns 0, and calling "(kill 0 SIGTERM)"
kills all processes.

Now, I really don't get how guix-daemon pgid could be zero. Man page of
setpgid(2) says:

--8<---------------cut here---------------start------------->8---
   A child created via fork(2) inherits its parent's process group ID.  The PGID  is
   preserved across an execve(2).
--8<---------------cut here---------------end--------------->8---

WDYT?

Thanks,

Mathieu