2017-02-13 59 views
1

我有一個Rails 5 API與Sidekiq和capistrano-sidekiq,在過去幾個月一直很高興地工作。Sidekiq無法啓動(獲得SIGHUP)

有一天,Sidekiq停止了處理工作。檢查日誌,我看到了

bundler: failed to load command: sidekiq (/home/user/project/shared/bundle/ruby/2.2.0/bin/sidekiq) 
SignalException: SIGHUP 
/home/user/project/shared/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/core_ext/module/attribute_accessors.rb:119:in `<class:Module>' 
/home/user/project/shared/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/core_ext/module/attribute_accessors.rb:6:in `<top (required)>' 
... (snip) 

每當我嘗試啓動Sidekiq時,上面都會出現在日誌中。它使用安靜命令(USR1)關閉並正確退出。

INFO: Received USR1, no longer accepting new work 

我正在使用Capistrano進行部署,它一直運行良好,直到發生這種情況。這是Capistrano用來啓動Sidekiq的命令:

INFO [2aac3b89] Running $HOME/.rbenv/bin/rbenv exec bundle exec sidekiq --index 0 --pidfile /home/user/project/shared/tmp/pids/sidekiq-0.pid --environment production --logfile /home/user/project/shared/log/sidekiq.log --daemon as [email protected] 
DEBUG [2aac3b89] Command: cd /home/user/project/current && (export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.2.3" ; $HOME/.rbenv/bin/rbenv exec bundle exec sidekiq --index 0 --pidfile /home/user/project/shared/tmp/pids/sidekiq-0.pid --environment production --logfile /home/user/project/shared/log/sidekiq.log --daemon) 
INFO [2aac3b89] Finished in 1.176 seconds with exit status 0 (successful). 

這是怎麼回事?我怎樣才能確保它未來不會發生?

回答

1

在capistrano,我有:pty設置爲true。我想這是在它有機會啓動之前殺死這個過程。我仍然不確定現在爲什麼這是一個問題,但設置:ptyfalse似乎已經做到了。

+0

我有同樣的問題。謝謝。 – mike927

+0

https://github.com/seuros/capistrano-sidekiq這裏標記了這個錯誤。 – lingceng