title: How can I start the rails server in parallel with the webpack server so that I can kill both at the same time?
body: <p>I'm looking for a way to spin up the rails development server in parallel with the webpack server. The problem is that if I run one of them in the background, when I <code>Ctrl^C</code> to close everything, one process continues to run in the background and can cause some odd behavior involving the addresses being in use.</p>
  
  <p>I have tried this:</p>
  
  <pre><code>$ rails s &amp; bin/webpack-dev-server
  
  // rails and webpack running in parallel
  
  $ sudo lsof -n -i :3000 -i :3035 | grep LISTEN
  
  ruby    26847 username   13u  IPv4 0xa889e9178532bffd      0t0  TCP 127.0.0.1:hbci (LISTEN)
  ruby    26847 username   14u  IPv6 0xa889e91781b9ae3d      0t0  TCP [::1]:hbci (LISTEN)
  node    26848 username   19u  IPv4 0xa889e9178e468ffd      0t0  TCP 127.0.0.1:fjsv-gssagt (LISTEN)
  </code></pre>
  
  <p>But as you can see, when you attempt to kill the process with <code>Ctrl^C</code>, there are still processes running on the port.</p>
  
  <pre><code>$ sudo lsof -n -i :3000 -i :3035 | grep LISTEN
  
  ruby    26847 username   13u  IPv4 0xa889e9178532bffd      0t0  TCP 127.0.0.1:hbci (LISTEN)
  ruby    26847 username   14u  IPv6 0xa889e91781b9ae3d      0t0  TCP [::1]:hbci (LISTEN)
  </code></pre>
  
  <p>I know that I could simply run these in separate terminals and kill both processes individually, but I would like to be able to create a yarn script that runs them both using something like <code>yarn start</code>.</p>