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: #2010
  • Loading branch information
hermunn committed Oct 12, 2016
1 parent f9526a5 commit 61cdc9d
Show file tree
Hide file tree
Showing 2 changed files with 10 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 @@ -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 **);
Expand Down
11 changes: 9 additions & 2 deletions bin/varnishd/mgt/mgt_child.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 61cdc9d

Please sign in to comment.