表单: RailsNotes
用户: dreamable
创建日期: 2021-03-28 22:11:03 UTC
更新日期: 2021-03-28 22:24:37 UTC
引用:(Table ID 3, Record ID 32)

标题 :
Sidekiq does not support logfile and pidfile since 6.0
笔记 :

A typical Sidekiq config file is like

:verbose: false
:concurrency: 4
:strict: false
:logfile: log/sidekiq.log
:pidfile: tmp/pids/sidekiq.pid
:queues:
  - default
  - mailers
development:
  :verbose: true
  :concurrency: 2
  :logfile: log/sidekiq_dev.log
  :pidfile: tmp/pids/sidekiq_dev.pid

However, the logfile and pidfile do not work with version 6.2.0. That's because the changes on 6.0.

  1. Remove the daemonization
  2. Remove logfile
  3. Remove pidfile Check here for discussion, why daemonization is bad, the pidfile problem

My current workaround:

  1. Logfile: redirect stdout to a file
  2. Pidfile: get from ps
pid=`ps aux | grep sidekiq | grep -v grep | awk '{print $2}'`;
kill $pid
cd /var/www/$proj/current/
bundle exec sidekiq -e production -C config/sidekiq.yml >& log/sidekiq.log &
标签: