-
-
Save pzskc383/175023bf4a53618ddf101af82292a7dd to your computer and use it in GitHub Desktop.
Unicorn service file for systemd with rvm support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# save this file in /etc/default/unicorn_app | |
USER=app_user | |
APP_ROOT=/srv/app | |
RVM_STRING=2.2.4@app_gemset | |
RACK_ENV=production | |
UNICORN_OPTS="-D -c /srv/app/shared/config/unicorn.rb -E production" | |
DAEMON=unicorn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
# You can create multiple unicorn service by linking unicorn@.service to unicorn@appone.service, unicorn@apptwo.service | |
# each application reads its settings from /etc/default/unicorn_appone, /etc/default/unicorn_apptwo | |
Description=Unicorn serving %I app | |
After=syslog.target | |
[Service] | |
Restart=always | |
RestartSec=10 | |
Type=forking | |
WorkingDirectory=/srv/%I/current | |
EnvironmentFile=/etc/default/unicorn_%I | |
SyslogIdentifier=unicorn-%I | |
PIDFile=/srv/%I/shared/pids/unicorn.pid | |
KillMode=mixed | |
KillSignal=SIGQUIT | |
User=%I | |
ExecStart=/usr/local/rvm/bin/rvm-shell ${RVM_STRING} -c "bundle exec ${DAEMON} ${UNICORN_OPTS}" | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment