如何在Mongrel下重新启动Rails,而不停止和启动Mongrel [英] How do you restart Rails under Mongrel, without stopping and starting Mongrel
问题描述
有一种方法可以在Mongrel运行时重新启动Rails应用程序(例如,当您更改了插件/配置文件时).或者,快速重新启动Mongrel. Mongrel给出了这些提示,但是您怎么做呢?
Is there a way to restart the Rails app (e.g. when you've changed a plugin/config file) while Mongrel is running. Or alternatively quickly restart Mongrel. Mongrel gives these hints that you can but how do you do it?
**信号准备就绪. TERM =>停止. USR2 =>重新启动. INT =>停止(不重新启动).
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).
**已注册Rails信号. HUP =>重新加载(不重新启动).可能效果不佳.
** Rails signals registered. HUP => reload (without restart). It might not work well.
推荐答案
第一个发现当前杂种pid路径的方法如下:
1st discover the current mongrel pid path with something like:
> ps axf | fgrep杂种
>ps axf | fgrep mongrel
您将看到类似以下的处理行:
you will see a process line like:
ruby/usr/lib64/ruby/gems/1.8/gems/swiftiply-0.6.1.1/bin/mongrel_rails start -p 3000 -a 0.0.0.0 -e development -P/home/xxyyzz/rails/myappname/tmp/pids/mongrel.pid -d
采用"-P/home/xxyyzz/rails/myappname/tmp/pids/mongrel.pid"部分,并按以下方式使用它:
Take the '-P /home/xxyyzz/rails/myappname/tmp/pids/mongrel.pid' part and use it like this:
> mongrel_rails重新启动-P/home/xxyyzz/rails/myappname/tmp/pids/mongrel.pid
>mongrel_rails restart -P /home/xxyyzz/rails/myappname/tmp/pids/mongrel.pid
通过PID 18481将USR2发送到Mongrel ...完成.
我用它来从可怕的破损管道"恢复到MySQL问题.
I use this to recover from the dreaded "Broken pipe" to MySQL problem.
这篇关于如何在Mongrel下重新启动Rails,而不停止和启动Mongrel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!