Skip to content

Instantly share code, notes, and snippets.

@crmaxx
Forked from velenux/rails-puma.service
Created June 30, 2017 10:19
Show Gist options
  • Save crmaxx/44f385d25a781159d5bc5ec43932d7f6 to your computer and use it in GitHub Desktop.
Save crmaxx/44f385d25a781159d5bc5ec43932d7f6 to your computer and use it in GitHub Desktop.
systemd service to start rails/puma
# based on https://gist.github.com/twtw/5494223
# create systemd service file for rails/puma startup
# 0. [if required: rvm use ruby@default]
# 1. rvm wrapper default systemd rails
# 2. put this file in /etc/systemd/system/rails-puma.service
# 3. systemctl enable rails-puma
# 4. systemctl start rails-puma
[Unit]
Description=Rails-Puma Webserver
[Service]
Type=simple
User=app
WorkingDirectory=/home/app/your-app
ExecStart=/home/app/.rvm/bin/systemd_rails server -e production
TimeoutSec=15
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