[Backgroundrb-devel] Upgrading from older version - how?

Jonathan Wallace jonathan.wallace at gmail.com
Mon Mar 31 10:49:42 EDT 2008


Hello,

I'd just like to update that my capistrano deploy tasks for
backgroundrb were incorrect for my situation.  In my case, the current
working directory for backgroundrb on deploy was the home directory of
the deploy user.  This caused some issues in my app.  Here are the
updated tasks which correct the issue.

  task :restart do
    run "mongrel_rails cluster::restart -C #{mongrel_conf}"
    restart_backgroundrb
  end

  task :restart_backgroundrb do
    begin stop_backgroundrb; rescue; end #this catches the bdrb error
where a PID file doesn't exist
    start_backgroundrb
  end

  task :stop_backgroundrb do
    run "cd #{deploy_to}/current &&
#{deploy_to}/current/script/backgroundrb stop"
  end

  task :start_backgroundrb do
    run "cd #{deploy_to}/current &&
#{deploy_to}/current/script/backgroundrb start"
  end

Jonathan

On Fri, Mar 28, 2008 at 2:44 PM, Jonathan Wallace
<jonathan.wallace at gmail.com> wrote:
>  I use capistrano and have added the following tasks to my
>  config/deploy.rb for handling the thrown error where a pid file
>  doesn't exist.
>
>   task :restart do
>     run "mongrel_rails cluster::restart -C #{mongrel_conf}"
>     restart_backgroundrb
>   end
>
>   task :restart_backgroundrb do
>     begin stop_backgroundrb; rescue; end #this catches the bdrb error
>  where a PID file doesn't exist
>     start_backgroundrb
>   end
>
>   task :stop_backgroundrb do
>     run "#{deploy_to}/current/script/backgroundrb stop"
>   end
>
>   task :start_backgroundrb do
>     run "#{deploy_to}/current/script/backgroundrb start"
>   end
>
>  Good luck!
>   Jonathan
>


More information about the Backgroundrb-devel mailing list