mperham/sidekiq — pull request #719 by benweint (2013-02-20 03:24:48+00:00)
Title: Make daemonization in Capistrano recipe optional to accommodate JRuby

Daemonization is cool, but unfortunately JRuby doesn't support `Process.daemon`, and thus doesn't work with the `-d` flag. I'd like to be able to still use the Capistrano recipes shipped with Sidekiq, but they're not usable on JRuby, since the -d flag is hard-coded into the options.

This change makes use of -d when starting Sidekiq conditional on a Capistrano variable called `:sidekiq_daemonize`, which defaults to true. So, by default, everyone will get the current behavior (daemonization), but users running on JRuby will have the option of doing a `set :sidekiq_daemonize, false` in their deploy.rb in order to fall back to the old nohup approach.

I realize having the two quite long command strings side-by-side is a little ew, if you find it objectionable I'm happy to pull out some of the commonalities. Let me know what you think!