title: Starting background tasks with Capistrano
body: <p>For my RubyOnRails-App I have to start a background job at the end of Capistrano deployment. For this, I tried the following in deploy.rb:</p>
  
  <pre><code>run "nohup #{current_path}/script/runner -e production 'Scheduler.start' &amp;", :pty =&gt; true
  </code></pre>
  
  <p>Sometimes this works, but most of the time it does not start the process (= not listed in ps -aux). And there are no error messages. And there is no nohup.out, not in the home directory and not in the rails app directory.</p>
  
  <p>I tried using trap('SIGHUP', 'IGNORE') in scheduler.rb instead of nohup, but the result is the same.</p>
  
  <p>The only way to get it work is removing the ":pty => true" and do a manual Ctrl-C at the end of "cap deploy". But I don't like this...</p>
  
  <p>Are there any other chances to invoke this Scheduler.start? Or to get some more error messages?</p>
  
  <p>I'm using Rails 2.3.2, Capistrano 2.5.8, Ubuntu Hardy on the Server</p>