Created
April 26, 2014 06:42
-
-
Save kazuph/11313429 to your computer and use it in GitHub Desktop.
supervisord + unicornでhot restart (deploy) する ref: http://qiita.com/kazuph/items/55a5f74b9dca2d17bd65
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
pip install git+https://github.com/kazuph/unicornherder.git |
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
[web] | |
command=bash -lc 'bundle exec unicornherder -u unicorn_rails -p tmp/pids/unicorn.pid -- -c config/unicorn.rb -E production' | |
numprocs=1 | |
autostart=true | |
autorestart=true | |
stopsignal=QUIT | |
startsecs=1 | |
user=yourname | |
redirect_stderr=true | |
stdout_logfile=/var/log/appname/app/app.log | |
stdout_logfile_maxbytes=0 | |
stdout_logfile_backups=0 | |
stderr_logfile=/var/log/appname/app/app.log | |
stderr_logfile_maxbytes=0 | |
stderr_logfile_backups=0 | |
environment=HOME="/home/app",USER="app" | |
directory=/home/yourname/appname |
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
$ cd /path/yourname/appname | |
$ kill -USR2 `cat tmp/pids/unicorn.pid` |
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
Use of --pid/-P is strongly discouraged | |
Use the 'pid' directive in the Unicorn config file instead |
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
opts.on("-P PATH", "DEPRECATED") do |v| | |
warn %q{Use of -P is ambiguous and discouraged} | |
warn %q{Use --path or RAILS_RELATIVE_URL_ROOT instead} | |
ENV['RAILS_RELATIVE_URL_ROOT'] = v | |
end |
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
- 'unicorn': 'unicorn -D -P "{pidfile}" {args}', | |
- 'unicorn_rails': 'unicorn_rails -D -P "{pidfile}" {args}', | |
- 'unicorn_bin': '{unicorn_bin} -D -P "{pidfile}" {args}', | |
+ 'unicorn': 'unicorn -D {args}', | |
+ 'unicorn_rails': 'unicorn_rails -D {args}', | |
+ 'unicorn_bin': '{unicorn_bin} -D {args}', |
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
COMMANDS = { | |
'unicorn': 'unicorn -D -P "{pidfile}" {args}', | |
'unicorn_rails': 'unicorn_rails -D -P "{pidfile}" {args}', | |
'unicorn_bin': '{unicorn_bin} -D -P "{pidfile}" {args}', | |
'gunicorn': 'gunicorn -D -p "{pidfile}" {args}', | |
'gunicorn_django': 'gunicorn_django -D -p "{pidfile}" {args}', | |
'gunicorn_bin': '{gunicorn_bin} -D -p "{pidfile}" {args}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment