如何让工头开始上帝

时间:2012-10-24 19:17:03

标签: ruby ruby-on-rails-3 foreman god

我有一个像这样的Procfile:

web: bundle exec unicorn -c config/unicorn.rb -E production
god: god -c services.god

但是foreman start god没有开始......只是这样说:

17:14:32 god.1  | started with pid 29506
17:14:32 god.1  | exited with code 0
17:14:32 system | sending SIGTERM to all processes
SIGTERM received

如果我运行god -c services.god,所有服务都运行良好...
任何想法?
谢谢

2 个答案:

答案 0 :(得分:5)

你不应该和领班一起跑神。 foreman用于指定应用程序中的所有后台(和Web)进程,而god是这些进程的进程监视框架。

通常,你应该:

  1. 直接在Procfile(而不是services.god)中指定所有流程,并使用foreman start在开发中运行它们。
  2. 使用god来监控生产过程。我使用我的foreman_god gem直接加载Procfile。或者,您可以export a god config file

  3. 那就是说,如果你真的想要从领班中运行上帝:默认情况下,上帝作为守护进程运行,守护进程不与领班一起工作(参见this wiki page)。如果你将-D(不要守护进程)选项传递给god:

    ,它应该可以工作
    god: god -D -c services.god
    

答案 1 :(得分:1)

如果你使用rvm上帝,可能应该使用这样的东西,

god: rvmsudo god -c /path_to_yourgod_file.god

但为什么你需要两个不同的监控系统,而你可以使用它们来完成工作?