title: How to start and stop subprocess from flask
body: <p>I have a flask app, from which I need to start few other apps (webrtc chats.)
  I can easily do it with gunicorn, but my problem is how to start 5-10-15 or more webrtc apps( can do this with gunicorn command) and then stop some of them but not all.</p>
  
  <p>So with this:</p>
  
  <pre><code>gunicorn --worker-class eventlet -w 1 --certfile /path/to/file --keyfile /path/to/file -b 0.0.0.0:8000 wsgi:app
  </code></pre>
  
  <p>command to start the server, each manager will start a server on its own port, no problems here. But how to store a process and then kill it, when the manager no longer needs server? I have no idea--any tips?</p>
  
  <pre><code>args = 'exec ' + gunicorn_command_above
  p = subprocess.Popen(args, stdout=subprocess.PIPE, shell=True)
  </code></pre>
  
  <p>So i can start servers with commands above, but don't know how to store and then kill process,
  thx for your time and help!</p>