Skip to content

Instantly share code, notes, and snippets.

@duderamos
Last active Jan 1, 2017
Embed
What would you like to do?
Unit file for unicorn
[Unit]
Description=Unicorn Server
Requires=redis.service
Wants=mysqld.service postgresql.service
After=redis.service mysqld.service postgresql.service
[Service]
Type=forking
User=netengine
WorkingDirectory=/var/www/unicorn/current
Environment=RAILS_ENV=production
SyslogIdentifier=unicorn
PIDFile=/var/www/unicorn/current/tmp/pids/unicorn.pid
Restart=always
ExecStart=/bin/sh -c "/etc/rbenv/shims/bundle exec unicorn_rails -D -c /var/www/unicorn/current/config/unicorn.rb -E production"
ExecReload=/bin/sh -c "/bin/kill -USR2 $MAINPID ; sleep 6 ; /bin/kill -QUIT $MAINPID"
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment