Skip to content

Commit

Permalink
Merge pull request rubber#201 from messick/unicorn_template_fixes
Browse files Browse the repository at this point in the history
Unicorn Template Fixes
  • Loading branch information
Alex Kremer committed Aug 9, 2012
2 parents ab6923e + 961195a commit bddf999
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions templates/unicorn/config/rubber/role/unicorn/unicorn-upstart.conf
@@ -0,0 +1,12 @@
<%
@path = "/etc/init/unicorn.conf"
@backup = false
%>
description "unicorn daemon"

start on runlevel [2345]
stop on runlevel [016]

script
exec /bin/bash -l -c 'cd <%= Rubber.root %> && exec bundle exec unicorn_rails -c <%= Rubber.root %>/config/unicorn.rb -E <%= Rubber.env %> -D >> log/unicorn_upstart.log 2>&1'
end script
7 changes: 7 additions & 0 deletions templates/unicorn/config/rubber/role/unicorn/unicorn.rb
Expand Up @@ -22,6 +22,13 @@
stderr_path "<%= Rubber.root %>/log/unicorn.stderr.log"
stdout_path "<%= Rubber.root %>/log/unicorn.stdout.log"
# Because of Capistano, we need to tell unicorn where find the current Gemfile
# Read about Unicorn, Capistrano, and Bundler here:
# http://unicorn.bogomips.org/Sandbox.html
before_exec do |server|
ENV['BUNDLE_GEMFILE'] = "<%= Rubber.root %>/Gemfile"
end
before_fork do |server, worker|
##
# When sent a USR2, Unicorn will suffix its pidfile with .oldbin and
Expand Down

0 comments on commit bddf999

Please sign in to comment.