暴发户不重生 Sidekiq 守护进程
Upstart not respawning Sidekiq daemon
我的 sidekiq 守护进程重启有问题。当守护进程崩溃时,新贵不会重生守护进程。这是我的 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 start 启动守护进程时,它可以工作,但如果杀死它则不会重生。
删除 -L log/sidekiq.log -d
。您不使用自定义日志文件或使用 Upstart 进行守护进程。
我的 sidekiq 守护进程重启有问题。当守护进程崩溃时,新贵不会重生守护进程。这是我的 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 start 启动守护进程时,它可以工作,但如果杀死它则不会重生。
删除 -L log/sidekiq.log -d
。您不使用自定义日志文件或使用 Upstart 进行守护进程。