[master] c41c30a New jail level - kill - used when killing is happening

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Wed Oct 12 10:37:04 CEST 2016


commit c41c30aa7f7dfba228af12d99987dac479494910
Author: Pål Hermunn Johansen <hermunn at varnish-software.com>
Date:   Tue Oct 11 13:42:55 2016 +0200

    New jail level - kill - used when killing is happening
    
    A new jail level, JAIL_MASTER_KILL, is introduced. The mgt process
    takes this level before killing the child process.
    
    Fixes: #2010

diff --git a/bin/varnishd/mgt/mgt.h b/bin/varnishd/mgt/mgt.h
index 590372d..a4d835a 100644
--- a/bin/varnishd/mgt/mgt.h
+++ b/bin/varnishd/mgt/mgt.h
@@ -88,6 +88,7 @@ enum jail_master_e {
 	JAIL_MASTER_FILE,
 	JAIL_MASTER_STORAGE,
 	JAIL_MASTER_PRIVPORT,
+	JAIL_MASTER_KILL,
 };
 
 typedef int jail_init_f(char **);
diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index a2c7fb1..b8c75e7 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -455,10 +455,17 @@ mgt_launch_child(struct cli *cli)
 
 static int
 kill_child(void) {
+	int i, error;
+
+	VJ_master(JAIL_MASTER_KILL);
 	if (MGT_FEATURE(FEATURE_NO_COREDUMP))
-		return (kill(child_pid, SIGKILL));
+		i = kill(child_pid, SIGKILL);
 	else
-		return (kill(child_pid, SIGQUIT));
+		i = kill(child_pid, SIGQUIT);
+	error = errno;
+	VJ_master(JAIL_MASTER_LOW);
+	errno = error;
+	return (i);
 }
 
 static void



More information about the varnish-commit mailing list