Want to stay on top? Ruby Weekly is a once-weekly e-mail newsletter covering the latest Ruby and Rails news.
     Feed Icon

daemon_controller: Automatic Daemon Process Management

By Eldon Alameda / August 27, 2008

After tackling the difficult task of improving Rails deployment, Phusion - the creators of Passenger (mod_rails) recently announced the availability of daemon_controller - a library (rather than a stand-alone tool) for managing daemons. It lets you write applications that manage daemons in a robust manner (e.g. mongrel_cluster or UltraSphinx could be adapted to use this library).

The primary motivation for using daemon_controller is to make it easier to have other applications (such as Rails apps) start daemons without encountering race conditions or parallel attempts. With a little work, daemon_controller makes it possible for your app to safely launch all the daemons that its functionality relies upon (UltraSphinx, BackgrounDRb, etc.).

The library is simple to use - though it does require that you know how to start the daemon, how to contact the daemon, and you must know where it will put its PID and log files. Source code is available at http://github.com/FooBarWidget/daemon_controller/tree/master

Comments

  1. Glenn says:

    Great news, on of the major thorns in my side of late has been insuring that ferret is started on an old up. And god doesn't handle task dependency at all so it's a convoluted shell script to make it all happen.

  2. Adam Greene says:

    Your description seems like it is very similar to the daemons gem. What's the difference here?

    Time to dive into the source code I guess.... ;)

  3. Peter Cooper says:

    Adam: The key is that it handles other applications launching the daemons almost as dependencies. The daemons gem provides daemon features to programs. This provides daemon control to non-daemons.

Other Posts to Enjoy

Twitter Mentions