[master] 9858175 Ensure everything under the process is terminated

Federico G. Schwindt fgsch at lodoss.net
Tue Sep 27 09:11:04 CEST 2016


commit 985817576213d55ae6f9a7b1a78afaee696f9770
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Tue Sep 27 08:09:19 2016 +0100

    Ensure everything under the process is terminated

diff --git a/bin/varnishtest/vtc_process.c b/bin/varnishtest/vtc_process.c
index 977587d..3dba551 100644
--- a/bin/varnishtest/vtc_process.c
+++ b/bin/varnishtest/vtc_process.c
@@ -205,6 +205,7 @@ process_start(struct process *p)
 		assert(dup2(out_fd, 1) == 1);
 		assert(dup2(err_fd, 2) == 2);
 		VSUB_closefrom(STDERR_FILENO + 1);
+		AZ(setpgid(0, 0));
 		AZ(execl("/bin/sh", "/bin/sh", "-c", VSB_data(cl), (char*)0));
 		exit(1);
 	}
@@ -255,7 +256,7 @@ process_kill(const struct process *p, const char *sig)
 	if (!p->running || !p->pid)
 		vtc_log(p->vl, 0, "Cannot signal a non-running process");
 
-	bprintf(buf, "kill -%s %d", sig, p->pid);
+	bprintf(buf, "kill -%s -%d", sig, p->pid);
 	vtc_log(p->vl, 4, "CMD: %s", buf);
 
 	s = system(buf);



More information about the varnish-commit mailing list