Skip to content

Instantly share code, notes, and snippets.

@merqlove
Last active February 2, 2017 15:30
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 merqlove/19b66736ed36628e71d1749856abdbef to your computer and use it in GitHub Desktop.
Save merqlove/19b66736ed36628e71d1749856abdbef to your computer and use it in GitHub Desktop.
SystemD Puma example
[Unit]
Description=MRCR Sites Puma Server
Requires=redis@6379.service mongod.service
Wants=redis@6379.service mongod.service
After=redis@6379.service mongod.service
[Service]
Type=simple
User=merkulov
PIDFile=/srv/apps/sites_mrcr_ru/shared/tmp/pids/puma.pid
WorkingDirectory=/srv/apps/sites_mrcr_ru/current
EnvironmentFile=/srv/apps/sites_mrcr_ru/.rbenv-vars
Environment=RAILS_ENV=production
Environment=PUMA_CONFIG_FILE=/srv/apps/sites_mrcr_ru/shared/config/puma.rb
ExecStart=/opt/rbenv/shims/bundle exec puma -C ${PUMA_CONFIG_FILE}
ExecStop=/opt/rbenv/shims/bundle exec pumactl -F ${PUMA_CONFIG_FILE} stop
ExecReload=/opt/rbenv/shims/bundle exec pumactl -F ${PUMA_CONFIG_FILE} phased-restart
TimeoutSec=15
Restart=always
StandardInput=null
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=%n
KillMode=process
TimeoutStopSec=5
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment