unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 99475ba0966795144932bac7fc18dea0ffcc1b00 848 bytes (raw)
name: patches/ngircd-handle-zombies.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
The Guile process taking the role of PID 1 during Guix builds does not reap
zombie processes, which makes them continue responding to "kill -0".

--- a/src/testsuite/stop-server.sh	2015-02-05 11:24:00.535908842 +0100
+++ b/src/testsuite/stop-server.sh	2015-02-05 11:25:00.264351349 +0100
@@ -1,6 +1,21 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
+process_is_alive(){
+    ! process_is_dead "$1" && ! process_is_undead "$1"
+}
+
+process_is_dead(){
+    ! kill -0 "$1"
+}
+
+process_is_undead(){
+    case $(ps -p "$1" -o state=) in
+        (Z*) true ;;
+        (*) false ;;
+    esac
+}
+
 [ -z "$srcdir" ] && srcdir=`dirname $0`
 
 # read in functions
@@ -24,7 +40,7 @@
 
 # waiting ...
 for i in 1 2 3 4 5; do
-  kill -0 $pid > /dev/null 2>&1; r=$?
+  process_is_alive $pid > /dev/null 2>&1; r=$?
   if [ $r -ne 0 ]; then
     echo " ok".
     exit 0

debug log:

solving 99475ba0966795144932bac7fc18dea0ffcc1b00 ...
found 99475ba0966795144932bac7fc18dea0ffcc1b00 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).