[Backgroundrb-devel] Start script not working when run via Rake

Jonathan Wallace jonathan.wallace at gmail.com
Fri Jan 4 08:15:50 EST 2008


I'd like to second this issue as well.  I haven't had time to
investigate (maybe an upgrade to the latest capistrano would fix it?)
but I have to manually stop and restart bdrb on my production server
after a deploy when we've updated the worker code.
 Jonathan

On Jan 4, 2008 5:07 AM, Olly Lylo <list at lylo.co.uk> wrote:
>
> > Okay, I have imported changes in stop part of script. Again, are you
> > able to start backgroundrb from command prompt? Is it that, just cap
> > tasks fails?
>
>
> Works fine from the command prompt -- it just doesn't start when run from
> the Cap task.
>
> > Try printing value of RAILS_HOME and see if its correct.
> >
>
> RAILS_HOME is correct.  I've added ':log: foreground' to my YML file and put
> some logging into the backgroundrb script as detailed below, to try and
> figure this out:
>
> when 'start'
>   if fork
>     puts 'Exiting'
>      exit
>   else
>     path = "#{RAILS_HOME}/log/backgroundrb.pid"
>     puts "Path = #{path}"
>     config_file =
> YAML.load(ERB.new(IO.read("#{RAILS_HOME}/config/backgroundrb.yml")).result)
>     op = File.open(path, "w")
>     op.write(Process.pid().to_s)
>     op.close
>     if config_file[:backgroundrb][:log].nil? or
> config_file[:backgroundrb][:log] != 'foreground'
>       log_file = File.open(SERVER_LOGGER,"w+")
>       [STDIN, STDOUT, STDERR].each {|desc| desc.reopen(log_file)}
>     end
>
>     puts "Creating proxing"
>     BackgrounDRb::MasterProxy.new ()
>   end
> puts "Done"
>
>
> The output is:
>
>  Path = /var/www/apps/my_app/releases/20080103141158/log/backgroundrb.pid
> Creating proxy
> Exiting
>
> This seems fine except the 'puts "Done"' statement at the end of the block
> isn't being callled.   Does this give you any idea about what might be
> happening?
>
>
> Cheers, Olly
> _______________________________________________
> Backgroundrb-devel mailing list
> Backgroundrb-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>



-- 
Jonathan Wallace


More information about the Backgroundrb-devel mailing list