Last active
February 9, 2022 09:21
-
-
Save errordeveloper/4329034 to your computer and use it in GitHub Desktop.
Upstart config for a Rails app using Unicorn HTTP server
This file contains hidden or 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
| description "My App" | |
| author "Ilya Dmitrichenko" | |
| start on virtual-filesystems | |
| stop on runlevel [06] | |
| env PATH=/etc/rbenv/shims:/usr/local/rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
| env RAILS_ENV=production | |
| setuid rails | |
| setgid rails | |
| chdir /opt/my_app/current | |
| pre-start exec bundle exec unicorn_rails -D -c /opt/my_app/shared/config/unicorn.rb --env production | |
| post-stop exec kill `cat /opt/my_app/shared/pids/unicorn.pid` |
Very good. This worked fine for me. Thank you.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why did you leave out the
respawnstanza? Does this restart unicorn when it crashes for any reason?