[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
21/31: daemon: Avoid kill -1 bug on the Hurd.
From: |
guix-commits |
Subject: |
21/31: daemon: Avoid kill -1 bug on the Hurd. |
Date: |
Tue, 24 Mar 2020 18:38:53 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd
in repository guix.
commit 61c2a887d73fac51c253914b5097df109d4df354
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));
- branch wip-hurd created (now 3d5bdf4), guix-commits, 2020/03/24
- 02/31: gnu: hurd: Fix hurd-target?, add hurd-system?., guix-commits, 2020/03/24
- 05/31: gnu: cross-libc: Build fix for the Hurd., guix-commits, 2020/03/24
- 12/31: gnu: commencement: gnumach-headers-boot0: Build from tarball., guix-commits, 2020/03/24
- 14/31: gnu: commencement: hurd-minimal-boot0: Build from tarball., guix-commits, 2020/03/24
- 06/31: Revert "gnu: guile-static-stripped: Update to 2.2.", guix-commits, 2020/03/24
- 09/31: gnu: bootstrap: Add support for the Hurd., guix-commits, 2020/03/24
- 04/31: gnu: glibc: Add signal SA_SIGINFO support for the Hurd., guix-commits, 2020/03/24
- 21/31: daemon: Avoid kill -1 bug on the Hurd.,
guix-commits <=
- 10/31: gnu: java-jansi-native: Compile fix for the Hurd., guix-commits, 2020/03/24
- 17/31: gnu: commencement: gnumach-headers-boot0: Update to 1.8-116-g28b53508., guix-commits, 2020/03/24
- 18/31: gnu: commencement: glibc-final: Allow gnumach-headers references., guix-commits, 2020/03/24
- 25/31: gnu: pciutils: Build fixes for the Hurd., guix-commits, 2020/03/24
- 28/31: gnu: screen: Build fix for the Hurd., guix-commits, 2020/03/24
- 19/31: gnu: hurd: Update to hurd-headers version: 0.9-91a51672., guix-commits, 2020/03/24
- 01/31: gnu: grub: Support for the Hurd., guix-commits, 2020/03/24
- 08/31: gnu: bootstrap: Use fall-back mechanism for bootstrap-executables., guix-commits, 2020/03/24
- 27/31: gnu: inetutils: Support for the Hurd., guix-commits, 2020/03/24
- 03/31: gnu: glibc: Add clock patches for the Hurd., guix-commits, 2020/03/24