> 1. What is the best way to determine whether the app is indeed running > inside a unicorn server?
I actually wound up just setting an environment variable for this. I manage unicorn through an init.d, and just export UNICORN=true before it starts up the server. We have the exact scenario you describe, Unicorn in production and Passenger on our dev machines. > 2. Is there an established way for adding an after_fork hook after > Unicorn has already started up? I just recently had to solve this problem for my team. In my case, I've got multiple applications getting their unicorn configs managed through chef, and so didn't want to fill the chef with app-specific switches. Since the unicorn config file is just ruby code, I just have my config files check the app directory for a unicorn directory containing before_fork.rb and after_fork.rb files and load the files if they exist. It doesn't register the hooks after Unicorn starts, but it does let you define them outside of the config file. _______________________________________________ Unicorn mailing list - [email protected] http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
