wr0ngway/rubber — pull request #201 by messick (2012-08-09 18:06:45+00:00)
Title: Unicorn Template Fixes

I found two issues with the Unicorn template and this pull request has fixes for them.

1. There was no upstart conf file, so Unicorn did not startup when instance was rebooted

2. Since we weren't telling Unicorn where to find the Gemfile during a reload, it would continue to use the original Gemfile location. Because of Capistrano, this Gemfile would eventually get deleted as Cap remove old release directories. In this situation, if Unicorn was given the restart signal (during a deploy, for example) Unicorn would fail to reload and it would appear as if it was just ignoring the restart command (kill -USR2 $pid)

Issue 2 can be recreated by deploying a few times (5-6 should be enough) to a instance running Unicorn and then checking the unicorn.stderr.log and looking for something like:

/mnt/stageit-redroom/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:421:in `chdir': No such file or directory - /mnt/stageit-redroom/releases/20120809005246 (Errno::ENOENT)

[Here](http://unicorn.bogomips.org/Sandbox.html) is some Unicorn documentation for issue 2.