Skip to content

Instantly share code, notes, and snippets.

@stiig
Last active January 16, 2018 12:36
Show Gist options
  • Save stiig/dd1cbc8cb7bc08687b2263e9b5abfb06 to your computer and use it in GitHub Desktop.
Save stiig/dd1cbc8cb7bc08687b2263e9b5abfb06 to your computer and use it in GitHub Desktop.
simple puma systemd service
[Unit]
Description=My app
After=network.target, postgresql.service
[Service]
Type=forking
User=deploy
Environment=RAILS_ENV=production
Environment=RUBYOPT='-W0'
PIDFile=/home/deploy/apps/app_name/shared/tmp/pids/puma.pid
Restart=always
WorkingDirectory=/home/deploy/apps/app_name/current
ExecStart=/home/deploy/.rvm/bin/rvm 2.4.0@app_name do bundle exec puma -C /home/deploy/apps/app_name/shared/puma.rb --daemon
ExecStop=/home/deploy/.rvm/bin/rvm 2.4.0@app_name do bundle exec pumactl -S /home/deploy/apps/app_name/shared/tmp/pids/puma.state stop
[Install]
WantedBy=multi-user.target
@stiig
Copy link
Author

stiig commented Mar 23, 2017

to /etc/systemd/system/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment