title: SIGTERM unable to kill process
body: <p>I have a single-threaded process which is not dying on kill -TERM.  The process
  signal mask does not show that SIGTERM is blocked.  I'm executing 'kill' as
  root.  I'm able to kill the process using SIGKILL but this is part of a larger
  system and I'd like SIGTERM to work.</p>
  
  <pre><code>$ cat /proc/5105/status
  Name:   task_root.nginx
  State:  S (sleeping)
  Tgid:   5105
  Pid:    5105
  PPid:   1
  TracerPid:  0
  Uid:    1000    1000    1000    1000
  Gid:    1000    1000    1000    1000
  FDSize: 256
  Groups: 4 24 27 30 46 109 124 1000 
  VmPeak:  3304480 kB
  VmSize:  3304472 kB
  VmLck:         0 kB
  VmPin:         0 kB
  VmHWM:    249060 kB
  VmRSS:       320 kB
  VmData:  3228468 kB
  VmStk:      1012 kB
  VmExe:      3020 kB
  VmLib:     30232 kB
  VmPTE:      1076 kB
  VmSwap:   248288 kB
  Threads:    1
  SigQ:   0/63014
  SigPnd: 0000000000000000
  ShdPnd: 0000000000000000
  SigBlk: 0000000000000004
  SigIgn: 0000000000000000
  SigCgt: 2000000181001cef
  CapInh: 0000000000000000
  CapPrm: 0000000000200000
  CapEff: 0000000000200000
  CapBnd: ffffffffffffffff
  Cpus_allowed:   ff
  Cpus_allowed_list:  0-7
  Mems_allowed:   00000000,00000001
  Mems_allowed_list:  0
  voluntary_ctxt_switches:    16
  nonvoluntary_ctxt_switches: 1
  </code></pre>
  
  <p>Note the Sig* properties.  SigCgt, SigIgn, and SigBlk indicate that SIGTERM is neither caught, ignored, or blocked (bit #15 is unset - counting least significant bit as #1).  Since the default disposition for SIGTERM is to terminate the process, I'd expect it to get killed.  But that does not happen -</p>
  
  <pre><code>$ sudo kill -TERM 5105
  
  $ cat /proc/5105/status | grep Name
  Name:   task_root.nginx
  </code></pre>
  
  <p>The process is blocked in the wait() system call, waiting for termination of a sub-process:</p>
  
  <pre><code>$ sudo cat /proc/5105/stack
  [&lt;ffffffff8106bfc4&gt;] do_wait+0x1e4/0x260
  [&lt;ffffffff8106d230&gt;] sys_wait4+0xa0/0xf0
  [&lt;ffffffff81668d02&gt;] system_call_fastpath+0x16/0x1b
  [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff
  </code></pre>
  
  <p>The process is a single threaded process that was created using clone() with flags SIGCHLD | CLONE_NEWPID | CLONE_NEWNS.  The PID 5105 is the top level PID as viewed from the parent (default) PID namespace.</p>
  
  <p>Killing the process with SIGKILL works showing that PID or process tracking is not a problem.</p>