Skip to content

Instantly share code, notes, and snippets.

@halida
Created June 1, 2017 13:33
Show Gist options
  • Save halida/56868b195b53b5644fb703bcd7257efb to your computer and use it in GitHub Desktop.
Save halida/56868b195b53b5644fb703bcd7257efb to your computer and use it in GitHub Desktop.
Manage rails process by systemd
# copy from https://github.com/macournoyer/thin/pull/184#issuecomment-191119259
[Unit]
Description=haterslist
After=syslog.target network.target
[Service]
Type=forking
User=production
Group=production
WorkingDirectory=/home/production/apps/haterslist/current
ExecStart=/bin/bash -lc 'bundle exec thin start -C /home/production/apps/haterslist/current/config/thin.yml'
ExecReload=/bin/bash -lc 'bundle exec thin restart -C /home/production/apps/haterslist/current/config/thin.yml'
ExecStop=/bin/bash -lc 'bundle exec thin stop -C /home/production/apps/haterslist/current/config/thin.yml'
MemoryMax=512M
Restart=always
RestartSec=3
TimeoutSec=300
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment