独角兽重启/升级不起作用 [英] Unicorn restart/upgrade doesn't work

查看:43
本文介绍了独角兽重启/升级不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的独角兽初始化脚本的链接.https://gist.github.com/1466775

Following is link to my init script for unicorn. https://gist.github.com/1466775

重启命令对我来说从来没有用过.每次部署后,我都使用升级来重新启动独角兽.但是每当有重大变化(例如添加新宝石)时,升级将不起作用.最近,我用 airbrake 替换了 hoptoad gem,它错误地说未初始化的常量 Airbrake (NameError)".但是当我停止并再次启动独角兽时,它运行良好.问题出在初始化脚本还是其他问题?

Restart command has never worked for me. I am using upgrade to restart unicorn after each deploy. But whenever there is major changes like new gems being added, upgrade won't work. Recently, i replaced hoptoad gem with airbrake and it errors out saying 'uninitialized constant Airbrake (NameError)'. But when i stopped and started unicorn again, it worked fine. Does the problem lies in init script or its different problem?

谢谢.

推荐答案

根据你的init脚本,/bin/init.d/unicorn restart"向unicorn master进程发送HUP信号

According to your init script, "/bin/init.d/unicorn restart" sends HUP signal to unicorn master process

------裁剪

restart|reload)
    sig HUP && echo reloaded OK && exit 0
    echo >&2 "Couldn't reload, starting '$CMD' instead"
    su - $USER -c "$CMD"

-----裁剪

这就是 HUP 对独角兽进程所做的:

This is what HUP does to unicorn process :

重新加载配置文件并优雅地重新启动所有工作程序.如果preload_app"指令为false(默认值),则worker 还会在重新启动时获取任何应用程序代码更改.如果preload_app"为真,则应用程序代码更改将无效.

reloads config file and gracefully restart all workers. If the "preload_app" directive is false (the default), then workers will also pick up any application code changes when restarted. If "preload_app" is true, then application code changes will have no effect.

您正在寻找的是 USR2 信号,您对 unicorn 的升级参数已经在执行!

What you are looking for is USR2 signal which your upgrade parameter to unicorn is already doing !

USR2 信号重新执行正在运行的二进制文件.一旦验证子进程已启动并正在运行,就应向原始进程发送一个单独的 QUIT.

USR2 signal re-executes the running binary. A separate QUIT should be sent to the original process once the child is verified to be up and running.

这篇关于独角兽重启/升级不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆