I would suggest using runit. We currently have a bunch of services in production, and it works great.
This only involves creating a simple script named run shell, pointing runit to its containing directory and then running it. Services should not demonize themselves, but runit manages pid files, etc.
There is a command ( sv
) for starting, stopping and requesting services. ( sv start|stop|status|restart yourapp
).
A quick google search gave me this http://rubygems.org/gems/capistrano-runit , although I don't use capistrano at all, so I can't vouch for its usefulness.
http://smarden.org/runit/
The best place to start is faq: http://smarden.org/runit/faq.html
In debian you are just apt-get install runit
and good to go. update-service --add /your/service/dir/
register the service using runit.
During deployment, we stop the services, modify the binaries, and start the services; it is really simple.
source share