尝试了几个小时后(还试图使用God和Bluepill),我决定在这里问我的问题,因为我完全无能为力,因此我无法解决这个问题。OSX/Linux上的Monit + RVM + Thin
我有一个Rails应用程序。我想用Thin作为我的应用服务器。我想用Monit来监控我的Thin实例。我使用RVM作为我的本地用户来管理我的Ruby版本。
我已成立,将assumably做我想做的事情,但下面的monit文件不:
check process thin-81
with pidfile /Users/Michael/Desktop/myapp/tmp/pids/thin.81.pid
start program = "/Users/Michael/.rvm/gems/ruby-1.9.2-p180/bin/thin start -c /Users/Michael/Desktop/myapp -e production -p 81 -d -P tmp/pids/thin.81.pid"
stop program = "/Users/Michael/.rvm/gems/ruby-1.9.2-p180/bin/thin stop -c /Users/Michael/Desktop/myapp -P tmp/pids/thin.81.pid"
if totalmem is greater than 150.0 MB for 2 cycles then restart
如果我只是复制/粘贴start program
在命令行(外Monit)它的工作原理。之后再停止Thin实例stop program
也是如此。但是,通过Monit运行它似乎不起作用。
在-v
详细模式下运行它产生以下:
monit: pidfile '/Users/Michael/Desktop/myapp/tmp/pids/thin.81.pid' does not exist
这使我相信,从来不薄初始化。 Monit运行的是root
还是别的?如果它确实存在,那么它显然不会安装正确的宝石,因为我使用的是RVM,而不是“系统”Ruby。我目前在OSX上(但最终会部署到Linux) - 有谁知道这可能是什么原因?如果Monit是通过root运行的,那么我怎样才能让它使用RVM?或者我可以告诉Monit执行启动/停止程序Michael:staff
(我认为它将在OSX上?)
任何帮助非常感谢!
谢谢,这是我不知道的。 :) – 2011-05-25 12:06:28