Puma as a service using Upstart
Managing the jungle
Puma apps are referenced in /etc/puma.conf by default. Add each app’s path as a new line, e.g.:
Start the jungle running:
This script will run at boot time.
Start a single puma like this:
Everything is logged by upstart, defaulting to /var/log/upstart
.
Each puma instance is named after its directory, so for an app called /home/apps/my-app
the log file would be /var/log/upstart/puma-_home_apps_my-app.log
.
Conventions
- The script expects:
- a temporary folder to put the PID, socket and state files to exist called
tmp/puma
. E.g.:/home/apps/my-app/tmp/puma
. Puma will take care of the files for you.
- a temporary folder to put the PID, socket and state files to exist called
Before starting…
You need to customise puma.conf
to:
- Set the right user your app should be running on unless you want root to execute it!
- Look for and
setgid apps
, uncomment those lines and replaceapps
to whatever your deployment user is.
- Look for and
- Uncomment the source lines for
rbenv
or support unless you use a system wide installation of Ruby.