title: Docker Container won't stop with bash jobcontrol enabled
body: <p>I have a very simple Dockerfile which extends the mssql one, as you can see below.
  Two additional scripts are put into the final image, one with some database setup stuff, the otherone the <code>entrypoint.sh</code> which I use as wrapper to first start the sql server and the import script. when this is done, the sql process should come back to the foreground, which it does.</p>
  
  <p>I have a main process and some kinda temporary setup script, which has to run after the main process started. After the helper script finished. The main process comes back to foreground and should handle all signals. However it does not.</p>
  
  <p>There is even an example project in the <a href="https://docs.docker.com/config/containers/multi-service_container/" rel="nofollow noreferrer">docker documentation</a> which does exactly the same.</p>
  
  <p>Is there any way getting this to work since this seems like a very common problem (and of course job control is a hack.)</p>
  
  <pre><code>#!/bin/bash
  
  # turn on bash's job control
  set -m
  
  # Start the primary process and put it in the background
  ./my_main_process &amp;
  
  # Start the helper process
  ./my_helper_process
  
  # the my_helper_process might need to know how to wait on the
  # primary process to start before it does its work and returns
  
  
  # now we bring the primary process back into the foreground
  # and leave it there
  fg %1
  </code></pre>