How do you restart Rails under Mongrel, without stopping and starting Mongrel

半城伤御伤魂 提交于 2019-11-30 19:27:24

You can add the -c option if the config for your app's cluster is elsewhere:

mongrel_rails cluster::restart -c /path/to/config

1st discover the current mongrel pid path with something like:

>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

Take the '-P /home/xxyyzz/rails/myappname/tmp/pids/mongrel.pid' part and use it like this:

>mongrel_rails restart -P /home/xxyyzz/rails/myappname/tmp/pids/mongrel.pid

Sending USR2 to Mongrel at PID 18481...Done.

I use this to recover from the dreaded "Broken pipe" to MySQL problem.

in your rails home directory

mongrel_rails cluster::restart

For example,

killall -USR2 mongrel_rails
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!