Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting Resque at boot / Passenger restart

My environment: Rails 3.2.x with RVM, Passenger, Apache on Linux (Ubuntu), I am not using Capistrano and not intending to do so for the time being.

I have integrated Resque into my Rails application and all works well when manually starting resque with

rake RAILS_ENV=production environment resque:work QUEUE='*'

Next step is to have Resque startup (restart) automatically when Passenger starts (restarts).

How do I go about this?

like image 408
KKK Avatar asked Nov 04 '22 21:11

KKK


1 Answers

What about using foreman for this issue?

Foreman is a procfile-based tool to manage multi-process rails apps.

A simple intro can be seen at railscasts. An example may look like this:

web: bundle exec rails server
solr: bundle exec rake sunspot:solr:run
resque: rake RAILS_ENV=production environment resque:work QUEUE='*'
like image 78
ernd enson Avatar answered Nov 09 '22 15:11

ernd enson