Skip to content

Commit

Permalink
Merge pull request #2903 from flx42/fix-pid-namespace-pdeathsig-handling
Browse files Browse the repository at this point in the history
Fix PID namespace pdeathsig handling
  • Loading branch information
brauner committed Mar 12, 2019
2 parents 2009688 + b765aa8 commit 45265bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lxc/start.c
Expand Up @@ -1112,7 +1112,7 @@ static int do_start(void *data)
* exit before we set the pdeath signal leading to a unsupervized
* container.
*/
ret = lxc_set_death_signal(SIGKILL, 0);
ret = lxc_set_death_signal(SIGKILL, handler->monitor_pid);
if (ret < 0) {
SYSERROR("Failed to set PR_SET_PDEATHSIG to SIGKILL");
goto out_warn_father;
Expand Down
4 changes: 2 additions & 2 deletions src/lxc/utils.c
Expand Up @@ -1705,9 +1705,9 @@ int lxc_set_death_signal(int signal, pid_t parent)
ret = prctl(PR_SET_PDEATHSIG, prctl_arg(signal), prctl_arg(0),
prctl_arg(0), prctl_arg(0));

/* Check whether we have been orphaned. */
/* If not in a PID namespace, check whether we have been orphaned. */
ppid = (pid_t)syscall(SYS_getppid);
if (ppid != parent) {
if (ppid && ppid != parent) {
ret = raise(SIGKILL);
if (ret < 0)
return -1;
Expand Down

0 comments on commit 45265bf

Please sign in to comment.