summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gnu/services/base.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 3b85363fe2..9bc78bd1ae 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -182,6 +182,8 @@ stopped before 'kill' is called."
                                              (@ (ice-9 rdelim) read-string))))
                              '()))
 
+                       (define lset= (@ (srfi srfi-1) lset=))
+
                        ;; When this happens, all the processes have been
                        ;; killed, including 'deco', so DMD-OUTPUT-PORT and
                        ;; thus CURRENT-OUTPUT-PORT are dangling.
@@ -206,6 +208,15 @@ stopped before 'kill' is called."
                              (kill-except omitted-pids SIGKILL)
                              (delete-file #$%do-not-kill-file)))
 
+                       (let wait ()
+                         (let ((pids (processes)))
+                           (unless (lset= = pids (cons 1 omitted-pids))
+                             (format #t "waiting for process termination\
+ (processes left: ~s)~%"
+                                     pids)
+                             (sleep 2)
+                             (wait))))
+
                        (display "all processes have been terminated\n")
                        #f))
              (respawn? #f)))))