[Backgroundrb-devel] Unable to start with Capistrano...

Brett Walker lapomme00 at gmail.com
Mon Sep 4 13:55:31 EDT 2006


I already had it setup like Ezra, and I could *not* get it to work,
even after much gnashing of teeth.  The task would always look like it
was successful, and the pid file would be sitting there, but the
process would be gone.  Somehow it must have still been attached to
the ssh process.

Jonathan's script definitely works.  Bummed I need another script, but
glad it's automated now.

Cheers,
Brett

On 9/2/06, Jonathan Métillon <jmetillon at gmail.com> wrote:
> On 9/1/06, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
> >
> > Here are my tasks for stopping, starting and restarting.
> >
> >    desc <<-DESC
> >    Stop the backgroundrb server
> >    DESC
> >    task :stop_backgroundrb , :roles => :drb do
> >      run "#{current_path}/script/backgroundrb/stop"
> >    end
> >
> >    desc <<-DESC
> >    Start the backgroundrb server
> >    DESC
> >    task :start_backgroundrb , :roles => :drb do
> >      run "#{current_path}/script/backgroundrb/start -d"
> >    end
> >
> >    desc <<-DESC
> >    Start the backgroundrb server
> >    DESC
> >    task :restart_backgroundrb , :roles => :app do
> >      stop_backgroundrb
> >      start_backgroundrb
> >    end
> >
> >
> > Cheers-
> > -Ezra
>
> Maybe this is overkill but here is a bash script I've wrote to
> forcefully restart BackgrounDRb:
>
> #!/bin/sh
>
> if [ -a "log/backgroundrb.pid" ]; then
>   pid=`cat log/backgroundrb.pid`
>   if [[ -n "$pid" ]]; then
>     echo "Killing current BackgrounDRb server (pid: $pid)"
>     kill -9 $pid
>   fi
> fi
>
> echo "Starting the BackgrounDRb server"
> cd /var/www/123/current
> log="/tmp/backgroundrb.`date +%s`"
> echo "Writing to $log"
> nohup rake backgroundrb:start > $log 2>&1
> cat $log
> rm -f $log
>
> It is derived from a script I found while googling, I don't remember
> who it's from so I can't give credit.
>
> Here's what I added to my deploy recipe:
>
> task :before_restart, :roles => :app do
>   sudo "#{release_path}/script/backgroundrb/restart"
> end
> _______________________________________________
> Backgroundrb-devel mailing list
> Backgroundrb-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>


More information about the Backgroundrb-devel mailing list