title: how do I get a process to reload itself in linux?
body: <p>I have a service, say foo, written in C++, that runs as root.  There is the usual scrip, /etc/init.d/foo start|stop|restart.</p>
  
  <p>At certain times, foo needs to reload itself.  Normally after an upgrade has finished.  But doing things like:</p>
  
  <pre><code>system("/etc/init.d/foo restart")
  </code></pre>
  
  <p>doesn't work since as soon as restart kills foo, the system() call obviously gets killed as well, and the restart script never executes to completion.</p>
  
  <p>Is there another call I can use instead of system() that runs asynchronously as a sibling to the calling process, instead of creating a synchronous child?</p>
  
  <p>Thanks!</p>