title: Run a detached process with fabric and screen
body: <p>According to the <a href="http://www.fabfile.org/faq.html#why-can-t-i-run-programs-in-the-background-with-it-makes-fabric-hang" rel="nofollow">FAQ</a>, from the recommended ways to run a detached process, the only one that works for me is <code>screen</code> since I cannot install programs on the server and can't seem to make nohup work. I would like to:</p>
  
  <ul>
  <li>run(command) so that the command keeps running without blocking.</li>
  <li>Know the pid of the process I am running so I can kill it later.</li>
  </ul>
  
  <p>No combination of nohup redirections and <code>screen -md command</code> has worked for me so far.</p>
  
  <p>In particular, running this command line does work when executed directly on the server but not trough the run function of fabric. I believe the process is closed when the function returns and I have no time to see it:</p>
  
  <p><code>
  nohup /opt/logstash/bin/logstash agent -f /home/unicryo/PVSS_projects/GenerateErrors/logstash_conf/logstash-config-minimum.cfg &gt;&gt; test.out 2&gt;&amp;1 &amp;
  </code></p>