2017-07-31 30 views

回答

1

我认为touch tmp/restart.txt方法是乘客特定的。使用独角兽,您可以从更新代码的目录中发送一个USR2信号以杀死它,然后重新启动Unicorn实例。

根据您使用的操作系统,发送信号可能不同(sig vs kill等)。另外假设您使用Capistrano进行部署:

# Kill unicorn 
run "kill -s USR2 `cat #{unicorn_pid_file_location}`" 

# then restart unicorn with updated config 
run "#{unicorn_rails_or_unicorn} -C#{your_current_folder}/config/unicorn.rb -D -E production" 
+0

谢谢。似乎应该重新启动独角兽,但不是nginx。铁轨的变化是必须杀死老麒麟pid? –

+0

是的,你不需要重新启动nginx –

+0

谢谢。这些信息对我有好处。 –

相关问题