title: Start redis in the foreground and a node server with one command in parallel but in series
body: <p>There are tools like <a href="https://github.com/mysticatea/npm-run-all" rel="nofollow noreferrer">npm-run-all</a> that allow persistent processes to run in parallel in one process. I am interested in doing this with <code>redis</code> and a <code>node</code> server.</p>
  
  <p>However I am looking for a way to run the two in parallel, but only run the <code>node</code> process when the <code>redis</code> process is verifiably successful.</p>
  
  <p>Is there any unix / bash tool that can achieve what I want?</p>
  
  <p>I can see this working in two ways:</p>
  
  <p><strong>Option 1</strong></p>
  
  <p>A tool that <strong><em>checks for specific stdout from a process</em></strong> for instance <code>redis</code> will write <code>Ready to accept connections</code> to stdout, the tool would watch for this as a regular expression. When it has received it an event internally would fire and the <code>node</code> server would be run.</p>
  
  <p><strong>Option 2</strong></p>
  
  <p>A tool that <strong><em>checks if / when the http connection is available</em></strong> for a specific server and when it receives a proper health check response the internal event is fired and the subsequent <code>node</code> server would be run. There would also need to be a timeout involved. The con with this is that it's only specific to processes that spin up servers and endpoints on a consistent local port. </p>