Skip to content

Instantly share code, notes, and snippets.

@duderamos
Last active January 1, 2017 22:20
Show Gist options
  • Save duderamos/070502f88c9caf900f2d9eb1ddd1c5a3 to your computer and use it in GitHub Desktop.
Save duderamos/070502f88c9caf900f2d9eb1ddd1c5a3 to your computer and use it in GitHub Desktop.
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