title: How does supervisord stop processes inside a Docker container (trap kill signals)
body: <p>When you send a stop or kill command (with some specific signal, eg. HUP, TERM etc) to a docker container, how does supervisord intercept that signal and send it to its child processes?</p>
  
  <p>How can I gracefully stop my process inside a container when using supervisord?</p>
  
  <p>There are two properties that can be specified in the <code>[program:x]</code> section: <code>stopsignal</code> and <code>stopwaitsecs</code>. But it appears that there is no way to specify a custom shutdown/stop script (eg. tomcat_shuytdwon.sh or something alike). Some programs use a custom shutdown process to gracefully stop.</p>