Skip to content

Commit

Permalink
New jail level - kill - used when killing is happening
Browse files Browse the repository at this point in the history
A new jail level, JAIL_MASTER_KILL, is introduced. The mgt process
takes this level before killing the child process.

Fixes: varnishcache#2010
  • Loading branch information
hermunn committed Oct 10, 2016
1 parent 0b19a34 commit 5ffd000
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions bin/varnishd/mgt/mgt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 **);
Expand Down
9 changes: 7 additions & 2 deletions bin/varnishd/mgt/mgt_child.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,15 @@ mgt_launch_child(struct cli *cli)

static int
kill_child(void) {
int i;

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);
VJ_master(JAIL_MASTER_LOW);
return (i);
}

static void
Expand Down

0 comments on commit 5ffd000

Please sign in to comment.