title: Why does HHVM in daemon mode not start automatically after server reboot?
body: <p>HipHop/HHVM can be run as a daemon (so it starts automatically after rebooting) with</p>
  <pre><code>sudo /usr/bin/hhvm --mode daemon --config /etc/hhvm/server.hdf
  </code></pre>
  <p>When run, it works perfectly (which shows that the configs are okay). But after restarting the machine HHVM is gone and needs to be restarted manually. The above line incl. the configs have been taken out of official tutorials of the HHVM creators. Classic service syntax like <code>sudo service hhvm start</code> also works perfectly, but doesn't survice a machine restart.</p>
  <h3>What I've done to track down the problem:</h3>
  <p>The HHVM error log in /var/log/hhvm/error.log logs this line at each restart: <code>Unable to open pid file /var/run/hhvm/pid for write</code>. <code>/etc/hhvm/server.hdf</code> has <code>PidFile = /var/run/hhvm/pid</code> in first line. As this ships with HHVM by default, I don't want to change it. I think the <em>sudo</em> is the problem here. Without sudo HHVM won't run. Chmod 777'ing the pid file and pointing to another empty file don't solve the problem.</p>
  <h3>Question:</h3>
  <p>What's the <em>correct</em> way to install HHVM as a daemon ?</p>