title: Nginx and runit....what is best practice
body: <p>I am rather confused about ensuring that nginx is always up.  My understanding the init.d script justs start and stops nginx.  Is this correct?  Then in the docs its says to keep daemon = off;</p>
  
  <p>Now, I would like to use runit and the below is my runit run script:</p>
  
  <pre><code>#!/bin/sh
  exec /etc/init.d/nginx start
  </code></pre>
  
  <p>I notice that a new PID is always created.</p>
  
  <p>So in sum:
  1) I do NOT have this statement in the nginx file:</p>
  
  <pre><code>daemon = off;
  </code></pre>
  
  <p>2) I am using the above runit script but it always creates a new PID.</p>
  
  <p>So...what is best practice to ensuring that nginx is always running.  </p>
  
  <p>I am using monit by the way but would runit to own hte daemon.</p>
  
  <p>As a test, I did kill nginx using killall -9 nginx and I did a ps aux | grep nginx and noticed I got new pid's.  So..do I still need runit?  </p>