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)
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 47920a7b746..fd93e7f3f43 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. "
105 (read-pid-file pid-file 105 (read-pid-file pid-file
106 #:max-delay max-delay))) 106 #:max-delay max-delay)))
107 (#f 107 (#f
108 (catch-system-error (kill pid SIGTERM)) 108 ;; Send SIGTERM to the whole process group.
109 (catch-system-error (kill (- pid) SIGTERM))
109 #f) 110 #f)
110 ((? integer? container-pid) 111 ((? integer? container-pid)
111 ;; XXX: When COMMAND is started in a separate PID namespace, its 112 ;; XXX: When COMMAND is started in a separate PID namespace, its