Upstart没有重生Sidekiq守护进程

时间:2015-10-17 11:43:28

标签: ubuntu sidekiq upstart

我的sidekiq守护程序重启时遇到问题。当守护程序崩溃时,Upstart不会重新生成守护程序。这是我的Upstart初始化文件。

description "Sidekiq worker"
start on runlevel [2345]
stop on runlevel [06]

# change to match your deployment user
setuid user
setgid user
env HOME=/home/user

# restart the process if it crashes
respawn
# respawn a max of 3 times within 30 seconds
respawn limit 3 30

script
# this script runs in /bin/sh by default
# respawn as bash so we can source in rbenv
exec /bin/bash <<'EOT'
  # Pick your poison :) Or none if you're using a system wide installed Ruby.
  # rbenv
  # source /home/apps/.bash_profile
  # OR
  # source /home/apps/.profile
  # OR system:
  # source /etc/profile.d/rbenv.sh
  #
  # rvm
  source /home/user/.rvm/bin/rvm  

  cd /var/www/myapp/current
  exec sidekiq -c 10 -e production -L log/sidekiq.log -d
EOT
end script

当我使用Sercive启动启动守护程序时,它可以正常运行但是如果杀死它则不会重生。

1 个答案:

答案 0 :(得分:3)

删除-L log/sidekiq.log -d。您不使用自定义日志文件或daemonize与Upstart。

相关问题