Skip to content

Instantly share code, notes, and snippets.

@nofxx
Created January 5, 2015 19:15
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nofxx/f01dcfe3e9d504181d76 to your computer and use it in GitHub Desktop.
Save nofxx/f01dcfe3e9d504181d76 to your computer and use it in GitHub Desktop.
errbit unicorn systemd service
[Unit]
Description=Errbit Unicorn Server
Requires=mongodb.service
After=mongodb.service network.target
[Service]
# Change here: user, group and directory to errbit root
User=errbit
Group=errbit
WorkingDirectory=/var/www/apps/errbit
Environment=RAILS_ENV=production
SyslogIdentifier=errbit-unicorn
PIDFile=/run/errbit/errbit.pid
RuntimeDirectory=errbit
RuntimeDirectoryMode=775
CapabilityBoundingSet=
PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
ProtectHome=true
NoNewPrivileges=true
# Change here: unicorn.rb path
ExecStart=/usr/bin/bundle exec "unicorn_rails -c /var/www/apps/errbit/config/unicorn.rb -E production"
ExecStop=/usr/bin/kill -QUIT $MAINPID
ExecReload=/usr/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment