[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
30/33: daemon: Avoid kill -1 bug on the Hurd.
From: |
guix-commits |
Subject: |
30/33: daemon: Avoid kill -1 bug on the Hurd. |
Date: |
Fri, 13 Mar 2020 02:45:58 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd
in repository guix.
commit c6ee320b4299b02f7c59299c798748d7eecb457a
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.
---
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));
- 07/33: gnu: fontconfig: Build fix for the Hurd., (continued)
- 07/33: gnu: fontconfig: Build fix for the Hurd., guix-commits, 2020/03/13
- 09/33: gnu: glibc: Add signal SA_SIGINFO support for the Hurd., guix-commits, 2020/03/13
- 14/33: gnu: shepherd: Build fix for the Hurd., guix-commits, 2020/03/13
- 21/33: gnu: commencement: hurd-headers-boot0: Build from tarball., guix-commits, 2020/03/13
- 22/33: gnu: commencement: hurd-minimal-boot0: Build from tarball., guix-commits, 2020/03/13
- 26/33: gnu: commencement: static-bash-for-glibc: Hurd build fix., guix-commits, 2020/03/13
- 27/33: gnu: commencement: glibc-final: Allow gnumach-headers references., guix-commits, 2020/03/13
- 18/33: gnu: mit-krb5: Supprt for the Hurd., guix-commits, 2020/03/13
- 31/33: Revert "gnu: guile-static-stripped: Update to 2.2.", guix-commits, 2020/03/13
- 17/33: gnu: shadow: Build fix for the Hurd., guix-commits, 2020/03/13
- 30/33: daemon: Avoid kill -1 bug on the Hurd.,
guix-commits <=
- 15/33: gnu: inetutils: Support for the Hurd., guix-commits, 2020/03/13