执行 bundle exec cap production deploy 时候,执行到最后的** Execute unicorn:duplicate 执行失败。
cap aborted!
DEBUG [39d8e2fb] master failed to start, check stderr log for details
if [ -e /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid ] && kill -0 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then echo "Duplicating Unicorn..."; kill -s USR2 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid`; else if [ -e "/u/apps/rongyi_term_nanshan/current/config/unicorn.rb" ]; then UNICORN_CONFIG_PATH=/u/apps/rongyi_term_nanshan/current/config/unicorn.rb; else if [ -e "/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb" ]; then UNICORN_CONFIG_PATH=/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb; else echo "Config file for "production" environment was not found at either "/u/apps/rongyi_term_nanshan/current/config/unicorn.rb" or "/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb""; exit 1; fi; fi; if [ -e "/u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid" ]; then if kill -0 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then echo "Unicorn is already running!"; exit 0; fi; rm /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid; fi; echo "Starting Unicorn..."; cd /u/apps/rongyi_term_nanshan/current/ && RAILS_ENV=production BUNDLE_GEMFILE= /usr/local/rvm/bin/rvm 2.0.0-p353 do bundle exec unicorn -c $UNICORN_CONFIG_PATH -E deployment -D ; fi; stdout: Nothing written
if [ -e /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid ] && kill -0 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then echo "Duplicating Unicorn..."; kill -s USR2 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid`; else if [ -e "/u/apps/rongyi_term_nanshan/current/config/unicorn.rb" ]; then UNICORN_CONFIG_PATH=/u/apps/rongyi_term_nanshan/current/config/unicorn.rb; else if [ -e "/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb" ]; then UNICORN_CONFIG_PATH=/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb; else echo "Config file for "production" environment was not found at either "/u/apps/rongyi_term_nanshan/current/config/unicorn.rb" or "/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb""; exit 1; fi; fi; if [ -e "/u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid" ]; then if kill -0 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then echo "Unicorn is already running!"; exit 0; fi; rm /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid; fi; echo "Starting Unicorn..."; cd /u/apps/rongyi_term_nanshan/current/ && RAILS_ENV=production BUNDLE_GEMFILE= /usr/local/rvm/bin/rvm 2.0.0-p353 do bundle exec unicorn -c $UNICORN_CONFIG_PATH -E deployment -D ; fi; stderr: Nothing written
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/command.rb:94:in `exit_status='
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:142:in `block (4 levels) in _execute'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:551:in `call'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:551:in `do_request'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:561:in `channel_request'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:205:in `process'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:269:in `wait'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:164:in `block (2 levels) in _execute'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:514:in `call'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:205:in `process'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:166:in `block in _execute'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `tap'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `_execute'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:66:in `execute'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/bundler/gems/capistrano-unicorn-bf75a238fde0/lib/capistrano/tasks/unicorn.cap:121:in `block (3 levels) in <top (required)>'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `run'
/home/gong/.rvm/gems/ruby-2.0.0-p353@rongyi_term/gems/sshkit-1.3.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => unicorn:duplicate
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Command::Failed: if [ -e /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid ] && kill -0 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then echo "Duplicating Unicorn..."; kill -s USR2 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid`; else if [ -e "/u/apps/rongyi_term_nanshan/current/config/unicorn.rb" ]; then UNICORN_CONFIG_PATH=/u/apps/rongyi_term_nanshan/current/config/unicorn.rb; else if [ -e "/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb" ]; then UNICORN_CONFIG_PATH=/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb; else echo "Config file for "production" environment was not found at either "/u/apps/rongyi_term_nanshan/current/config/unicorn.rb" or "/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb""; exit 1; fi; fi; if [ -e "/u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid" ]; then if kill -0 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then echo "Unicorn is already running!"; exit 0; fi; rm /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid; fi; echo "Starting Unicorn..."; cd /u/apps/rongyi_term_nanshan/current/ && RAILS_ENV=production BUNDLE_GEMFILE= /usr/local/rvm/bin/rvm 2.0.0-p353 do bundle exec unicorn -c $UNICORN_CONFIG_PATH -E deployment -D ; fi; stdout: Nothing written
if [ -e /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid ] && kill -0 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then echo "Duplicating Unicorn..."; kill -s USR2 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid`; else if [ -e "/u/apps/rongyi_term_nanshan/current/config/unicorn.rb" ]; then UNICORN_CONFIG_PATH=/u/apps/rongyi_term_nanshan/current/config/unicorn.rb; else if [ -e "/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb" ]; then UNICORN_CONFIG_PATH=/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb; else echo "Config file for "production" environment was not found at either "/u/apps/rongyi_term_nanshan/current/config/unicorn.rb" or "/u/apps/rongyi_term_nanshan/current/config/unicorn/production.rb""; exit 1; fi; fi; if [ -e "/u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid" ]; then if kill -0 `cat /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then echo "Unicorn is already running!"; exit 0; fi; rm /u/apps/rongyi_term_nanshan/current/tmp/pids/unicorn.pid; fi; echo "Starting Unicorn..."; cd /u/apps/rongyi_term_nanshan/current/ && RAILS_ENV=production BUNDLE_GEMFILE= /usr/local/rvm/bin/rvm 2.0.0-p353 do bundle exec unicorn -c $UNICORN_CONFIG_PATH -E deployment -D ; fi; stderr: Nothing written
>