title: Starting a daemon from PHP
body: <p>For a website, I need to be able to start and stop a daemon process. What I am currently doing is</p>
  
  <pre><code>exec("sudo /etc/init.d/daemonToStart start");
  </code></pre>
  
  <p>The daemon process is started, but Apache/PHP hangs. Doing a <code>ps aux</code> revealed that <code>sudo</code> itself changed into a zombie process, effectively killing all further progress. Is this normal behavior when trying to start a daeomon from PHP?</p>
  
  <p>And yes, Apache has the right to execute the <code>/etc/init.d/daemonToStart</code> command. I altered the /etc/sudoers file to allow it to do so. No, I have not allowed Apache to be able to execute any kind of command, just a limited few to allow the website to work.</p>
  
  <p>Anyway, going back to my question, is there a way to allow PHP to start daemons in a way that no zombie process is created? I ask this because when I do the reverse, stopping an already started daemon, works just fine.</p>