[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
21/30: daemon: Avoid kill -1 bug on the Hurd.
From: |
guix-commits |
Subject: |
21/30: daemon: Avoid kill -1 bug on the Hurd. |
Date: |
Sat, 21 Mar 2020 19:36:29 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd
in repository guix.
commit 3f182bbd5f115f4b2eef5df978ae677aed0d61d6
Author: Manolis Ragkousis <address@hidden>
AuthorDate: Wed Dec 28 02:49:22 2016 +0200
daemon: Avoid kill -1 bug on the Hurd.
This allows for native builds on the Hurd, doing
sudo ./pre-inst-env guix-daemon --disable-chroot
--build-users-group=guixbuild &
./pre-inst-env guix build hello
* nix/libutil/util.cc (killUser)[__GNU__]: Avoid kill -1 bug; kill only
current process and ignore SIGKILL status in parent.
Co-authored-by: Jan Nieuwenhuizen <address@hidden>
---
nix/libutil/util.cc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc
index fb2dfad..17d145b 100644
--- a/nix/libutil/util.cc
+++ b/nix/libutil/util.cc
@@ -861,6 +861,10 @@ void killUser(uid_t uid)
which means "follow POSIX", which we don't want here
*/
if (syscall(SYS_kill, -1, SIGKILL, false) == 0) break;
+#elif __GNU__
+ /* Killing all a user's processes using PID=-1 does currently
+ not work on the Hurd. */
+ if (kill(getpid(), SIGKILL) == 0) break;
#else
if (kill(-1, SIGKILL) == 0) break;
#endif
@@ -873,6 +877,10 @@ void killUser(uid_t uid)
});
int status = pid.wait(true);
+#if __GNU__
+ /* When the child killed itself, status = SIGKILL. */
+ if (status == SIGKILL) return;
+#endif
if (status != 0)
throw Error(format("cannot kill processes for uid `%1%': %2%") % uid %
statusToString(status));
- 13/30: gnu: commencement: hurd-headers-boot0: Build from tarball., (continued)
- 13/30: gnu: commencement: hurd-headers-boot0: Build from tarball., guix-commits, 2020/03/21
- 16/30: gnu: commencement: hurd-source: Update to latest git., guix-commits, 2020/03/21
- 17/30: gnu: commencement: gnumach-headers-boot0: Update to 1.8-116-g28b53508., guix-commits, 2020/03/21
- 18/30: gnu: commencement: glibc-final: Allow gnumach-headers references., guix-commits, 2020/03/21
- 20/30: daemon: Do not use clone on the Hurd., guix-commits, 2020/03/21
- 22/30: gnu: less: Build fix for the Hurd., guix-commits, 2020/03/21
- 24/30: gnu: shadow: Add linux-pam dependency for the Hurd., guix-commits, 2020/03/21
- 26/30: gnu: shepherd: Build fix for the Hurd., guix-commits, 2020/03/21
- 09/30: gnu: bootstrap: Add support for the Hurd., guix-commits, 2020/03/21
- 19/30: gnu: hurd: Update to hurd-headers version: 0.9-91a51672., guix-commits, 2020/03/21
- 21/30: daemon: Avoid kill -1 bug on the Hurd.,
guix-commits <=
- 23/30: gnu: fontconfig: Build fix for the Hurd., guix-commits, 2020/03/21
- 25/30: gnu: pciutils: Build fixes for the Hurd., guix-commits, 2020/03/21
- 28/30: gnu: screen: Build fix for the Hurd., guix-commits, 2020/03/21
- 29/30: gnu: shadow: Build fix for the Hurd., guix-commits, 2020/03/21
- 27/30: gnu: inetutils: Support for the Hurd., guix-commits, 2020/03/21
- 30/30: gnu: mit-krb5: Supprt for the Hurd., guix-commits, 2020/03/21