# /etc/systemd/system/puma.service[Unit]Description=Puma HTTP Server
After=network.target
[Service]# Puma supports systemd's `Type=notify` and watchdog service# monitoring, if the [sd_notify](https://github.com/agis/ruby-sdnotify) gem is installed,# as of Puma 5.1 or later.# On earlier versions of Puma or JRuby, change this to `Type=simple` and remove# the `WatchdogSec` line.Type=notify
# If your Puma process locks up, systemd's watchdog will restart it within seconds.WatchdogSec=10User=rochefort
WorkingDirectory=/var/app/my_app/current
# Helpful for debugging socket activation, etc.#Environment=PUMA_DEBUG=1Environment=RAILS_ENV=production
Environment=RAILS_SERVE_STATIC_FILES=1ExecStart=/bin/bash -lc 'bundle exec puma -C config/puma.rb'Restart=always
[Install]WantedBy=multi-user.target
# After installing or making changes to puma.service
systemctl daemon-reload
# Enable so it starts on boot
systemctl enable puma.service
# Initial start up.
systemctl start puma.service
# Check status
systemctl status puma.service
# A normal restart. Warning: listeners sockets will be closed# while a new puma process initializes.
systemctl restart puma.service