How can I make sure the Sphinx daemon runs?

Posted by Ethan on Stack Overflow See other posts from Stack Overflow or by Ethan
Published on 2009-11-22T04:18:33Z Indexed on 2010/04/24 13:23 UTC
Read the original article Hit count: 277

I'm working on setting up a production server using CentOS 5.3, Apache, and Phusion Passenger (mod_rails). I have an app that uses the Sphinx search engine and the Thinking Sphinx gem.

According to the Thinking Sphinx docs...

If you actually want to search against the indexed data, then you’ll need Sphinx’s searchd daemon to be running. This can be controlled using the following tasks:

rake thinking_sphinx:start
rake ts:start
rake thinking_sphinx:stop
rake ts:stop

What would be the best way to ensure that this takes place in production? I can deploy my app, then manually run rake thinking_sphinx:start, but I like to set things up so that if I have to bounce the server, everything will come back up.

Should I put a call to that Rake task in an initializer? Or something in rc.local?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about ruby-on-rails