title: `trap`-ing Linux Signals - SIGSTOP?
body: <p>The Docker <a href="https://docs.docker.com/engine/reference/builder/" rel="nofollow">docs</a> note the following (w/ code) on how to run <code>clean up</code> upon a container's shutdown:</p>
  
  <blockquote>
    <p>Lastly, if you need to do some extra cleanup ... on shutdown, ..., you
    may need to ensure that the <code>ENTRYPOINT</code> script receives the Unix
    signals, passes them on, and then does some more work</p>
  </blockquote>
  
  <pre><code>#!/bin/sh
  
  trap "echo TRAPed signal" HUP INT QUIT KILL TERM
  
  /usr/sbin/apachectl start
  </code></pre>
  
  <p>I think that this <code>trap</code> will catch a <code>KILL</code> signal. However, I read in this <a href="https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86#.b8lb7rfrp" rel="nofollow">post</a>:</p>
  
  <blockquote>
    <p>All signals except for SIGKILL and SIGSTOP can be intercepted by the process.</p>
  </blockquote>
  
  <p>However, another <a href="http://linuxcommand.org/wss0160.php" rel="nofollow">post</a> states:</p>
  
  <blockquote>
    <p>There is one signal that you cannot trap: SIGKILL or signal 9.</p>
  </blockquote>
  
  <p>Which is it?</p>