Welcome Guest | Login

Problems starting BackgrounDRb

I am having problems starting BackgrounDRb on my site.
I followed the instructions on this post on how to setup BackgroundBRb:http://www.hostingrails.com/forums/rails_coding_thread/1055

To setup the background tasks I ran:
# script/plugin install svn://rubyforge.org/var/svn/backgroundrb
# rake backgroundrb:setup

Next I edited the config/backgroundrb.yml to the following (I have hidden my port number and changed the exact class name)
port: "MY_PORT_NUMBER"
timer_sleep: 60
load_rails: true
environment: development
host: 127.0.0.1
database_yml: config/database.yml
acl:
 deny: all
 allow: localhost 127.0.0.1
 order: deny,allow
autostart:
 1:
   job_key: job_name
   class: class_name_worker
This works fine on my local machine, but when I deploy it to hostingrails and try to run the following command
# rake backgroundrb:start

I get the following error
/usr/local/lib/ruby/1.8/drb/drb.rb:865:in `initialize': Cannot assign requested address - bind(2) (Errno::EADDRNOTAVAIL)
from /usr/local/lib/ruby/1.8/drb/drb.rb:865:in `open'
from /usr/local/lib/ruby/1.8/drb/drb.rb:865:in `open_server'
from /usr/local/lib/ruby/1.8/drb/drb.rb:759:in `open_server'
from /usr/local/lib/ruby/1.8/drb/drb.rb:757:in `each'
from /usr/local/lib/ruby/1.8/drb/drb.rb:757:in `open_server'
from /usr/local/lib/ruby/1.8/drb/drb.rb:1339:in `initialize'
from /usr/local/lib/ruby/1.8/drb/drb.rb:1627:in `new'
from /usr/local/lib/ruby/1.8/drb/drb.rb:1627:in `start_service'
 ... 21 levels...
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
from /home/myusername/rails/appname/script/backgroundrb/start:68
I am on the professional package and I do not have any Mongrel process running in my dedicated memory, so I was hoping to use it for this small background task.

I found this similar post but I am still having the same problem
Drb ferret server deployment won´t starthttp://www.hostingrails.com/forums/deployment_troubleshooting_thread/1357

Any help would be much appreciated  

2008-08-21 07:07 PM

Hello,

I have made some changes and started 'backgroundrb' now. Can you check and confirm status from your end now.

I could see that you have set the environment as development in 'backgroundrb.yml' file and I have swapped it to production mode.

2008-08-21 08:22 PM

Regards,
Rahul
Thanks for your help. That works now.

Here are some tips for anyone else trying to setup backgroundrb.

To start backgroundrb run the command
rake backgroundrb:start

To stop backgroundrb run the command
rake backgroundrb:stop

To check your process is running or stopped
ps -au | grep backgroundrb | grep -v grep

If you stop backgroundrb but the process is still running in the background use ps to find the process id and then run the following command to kill it.
kill PROCESS_ID

2008-08-21 10:09 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.