Sidekiq没有开始(获得SIGHUP)

时间:2017-02-13 05:54:45

标签: ruby-on-rails sidekiq capistrano3

我有一个带Sidekiq和capistrano-sidekiq的Rails 5 API,在过去的几个月里一直很愉快。

前几天,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时,上面会出现在日志中。它使用quiet命令(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 user@xxx.xxx.xxx.xxx
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 个答案:

答案 0 :(得分:1)

在capistrano中,我将:pty设置为true。我想这是在它有机会启动之前杀死了这个过程。我仍然不确定为什么现在这是一个问题,但将:pty设置为false似乎已经成功了。