Created
May 2, 2013 13:29
-
-
Save nhoffmann/5502164 to your computer and use it in GitHub Desktop.
Basic puma configuration because the example in the puma repo is shit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/init/puma.conf - Puma config | |
# This example config should work with Ubuntu 12+. It | |
# allows you to manage Puma instances with | |
# Upstart, Ubuntu's native service management tool. | |
# | |
# Save this config as /etc/init/puma.conf then mange puma with: | |
# sudo start puma app=/path/to/application | |
# sudo stop puma app=/path/to/application | |
# sudo status puma app=/path/to/application | |
# | |
# or use the service command: | |
# sudo service puma {start,stop,restart,status} app=/path/to/application | |
# | |
description "Puma Background Worker" | |
# no "start on", we don't want to automatically start | |
stop on (runlevel [06]) | |
# change deploy to match your deployment user if you want to use this as a less privileged user (recommended!) | |
setuid deploy | |
setgid deploy | |
respawn | |
respawn limit 3 30 | |
instance ${app} | |
script | |
chdir ${app} | |
logger -t puma "Starting server: $app" | |
rvm_env=`cat .ruby-version`@`cat .ruby-gemset` | |
export RUBYOPT=-Ku | |
exec /usr/local/rvm/bin/rvm-shell $rvm_env -c 'bundle exec puma -C config/puma.rb' | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment