title: Rails delayed_job startup start/stop capistrano
body: <p>As I've read somewhere, to start delayed_jobs with the server startup, I should write in config/deploy.rb the following:</p>
  
  <pre><code>require "delayed/recipes"
  
  set :rails_env, "production" #added for delayed job
  
  namespace :delayed_job do
    desc "Start delayed_job process" 
    task :start, :roles =&gt; :app do
      run "cd #{current_path}; script/delayed_job start #{rails_env}" 
    end
  
    desc "Stop delayed_job process" 
    task :stop, :roles =&gt; :app do
      run "cd #{current_path}; script/delayed_job stop #{rails_env}" 
    end
  
    desc "Restart delayed_job process" 
        task :restart, :roles =&gt; :app do
          run "cd #{current_path}; script/delayed_job restart #{rails_env}" 
    end
  end
  
  after "deploy:start", "delayed_job:start" 
  after "deploy:stop", "delayed_job:stop" 
  after "deploy:restart", "delayed_job:restart"
  </code></pre>
  
  <p>It's not working. In fact, I thought that this file did existed previowsly, but it wasn't (I creaded it).
  So what should I do to keep it working?</p>
  
  <p>And more questions, what should I do to stop/restart the processing of jobs during the web execution?</p>