Unicorn未能在USR2信号上产生工人

mar*_*igo 6 ruby-on-rails unicorn

我正在向主进程发送USR2信号,以便使用独角兽实现零停机时间部署.在老主人死了之后,我收到以下错误:

adding listener failed addr=/path/to/unix_socket (in use)

unicorn-4.3.1/lib/unicorn/socket_helper.rb:140:in `initialize':
Address already in use - /path/to/unix_socket (Errno::EADDRINUSE)
Run Code Online (Sandbox Code Playgroud)

旧的master before_fork在unicorn.rb配置文件的块中被杀死.该过程通过upstart启动,没有守护程序(-D)选项.关于发生了什么的任何想象?

mar*_*igo 2

事实证明,如果您希望能够进行零停机部署,则必须以守护程序模式 (-D) 运行。我在我的新贵脚本中更改了一些内容,现在它工作正常:

setuid username
pre-start exec unicorn_rails -E production -c /path/to/app/config/unicorn.rb -D
post-stop exec kill cat `/path/to/app/tmp/pids/unicorn.pid`
respawn
Run Code Online (Sandbox Code Playgroud)