summaryrefslogtreecommitdiff
path: root/gnu/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-06-12 00:03:07 +0200
committerLudovic Courtès <ludo@gnu.org>2020-06-12 00:04:42 +0200
commit8a02e45d93c2a825363da282791ac16f15b415e4 (patch)
tree474e5bb17ba0f51b6f6e235fe4d0cdd0ffa41ff4 /gnu/build
parentb6b95685d0b478698d648f13afd927b1e1700d99 (diff)
downloadguix-patches-8a02e45d93c2a825363da282791ac16f15b415e4.tar
guix-patches-8a02e45d93c2a825363da282791ac16f15b415e4.tar.gz
shepherd: 'read-pid-file/container' terminates the whole process group.
This mirrors a change made in the Shepherd 0.8.0. Previously, upon startup failure, we could have left processes behind. * gnu/build/shepherd.scm (read-pid-file/container): Kill (- PID) instead of PID.
Diffstat (limited to 'gnu/build')
-rw-r--r--gnu/build/shepherd.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/gnu/build/shepherd.scm b/gnu/build/shepherd.scm
index 47920a7b74..fd93e7f3f4 100644
--- a/gnu/build/shepherd.scm
+++ b/gnu/build/shepherd.scm
@@ -105,7 +105,8 @@ separate mount and PID name space. Return the \"outer\" PID. "
(read-pid-file pid-file
#:max-delay max-delay)))
(#f
- (catch-system-error (kill pid SIGTERM))
+ ;; Send SIGTERM to the whole process group.
+ (catch-system-error (kill (- pid) SIGTERM))
#f)
((? integer? container-pid)
;; XXX: When COMMAND is started in a separate PID namespace, its