Improve Unicorn Runit script
teohm opened this issue · 5 comments
I had issues with runit constantly restarting unicorn. So I took references those links and rewrote sv-unicorn-run.erb - https://gist.github.com/fabrikagency/5453473
I would have submitted a pull request, but I'm very new to chef and runit. I'd like feedback for improvement before submitting a pull request.
Also, this does appear to work with HUP and preload_app=true. Needs further testing.
@fabrikagency if you have time, is it possible to share your runit log /etc/sv/{app_name}/log/main/current
that shows the constantly unicorn restart error?
I can start my unicorn app successfully with the existing unicorn config template. I'm new to runit as well, so I wish to learn more about the root cause of your constant restart.
@teohm It looks like I had errors booting unicorn (permission denied for unicorn error logs and precompiling assets). I cleared those up yesterday at the same time I rewrote sv-unicorn-run.erb. Going back to the original sv-unicorn-run.erb works correctly now.
It may help others to update the blog post (http://teohm.github.io/blog/2013/04/17/chef-cookbooks-for-busy-ruby-developers/) to include the location of the runit logs and how to test running the unicorn exec without runit.
👍 See also: https://gist.github.com/justsee/5026661