[4.1] 61cdc9d New jail level - kill - used when killing is happening
PÃ¥l Hermunn Johansen
hermunn at varnish-software.com
Wed Oct 12 16:12:05 CEST 2016
commit 61cdc9d8416a27eb33948e9b838e25a8eb07fa5f
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 e59ec7f..a850a08 100644
--- a/bin/varnishd/mgt/mgt.h
+++ b/bin/varnishd/mgt/mgt.h
@@ -82,6 +82,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 8acde5e..d8ab431 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -459,10 +459,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