Skip to content

Instantly share code, notes, and snippets.

@chadwilken
Created August 23, 2018 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadwilken/e072871d8f0edd5b4708b3cf24b48de5 to your computer and use it in GitHub Desktop.
Save chadwilken/e072871d8f0edd5b4708b3cf24b48de5 to your computer and use it in GitHub Desktop.
Puma Systemd service
[Unit]
Description=Puma HTTP Server for <%= "#{fetch(:application)} (#{fetch(:stage)})" %>
After=network.target
Requires=puma.socket
[Service]
Type=simple
User=<%= fetch(:deploy_user) %>
Environment=RAILS_ENV=<%= fetch(:rails_env) %>
# Helpful for debugging socket activation, etc.
# Environment=PUMA_DEBUG=1
# The path to the puma application root
WorkingDirectory=<%= current_path %>
ExecStart=/bin/bash -lc '<%= shared_path %>/bin/puma -C <%= fetch(:puma_conf) %>'
# Path to PID file so that systemd knows which is the master process
PIDFile=<%= fetch(:puma_pid) %>
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment