我有一个像这样的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
,所有服务都运行良好...
任何想法?
谢谢
答案 0 :(得分:5)
你不应该和领班一起跑神。 foreman用于指定应用程序中的所有后台(和Web)进程,而god是这些进程的进程监视框架。
通常,你应该:
Procfile
(而不是services.god
)中指定所有流程,并使用foreman start
在开发中运行它们。那就是说,如果你真的想要从领班中运行上帝:默认情况下,上帝作为守护进程运行,守护进程不与领班一起工作(参见this wiki page)。如果你将-D(不要守护进程)选项传递给god:
,它应该可以工作god: god -D -c services.god
答案 1 :(得分:1)
如果你使用rvm上帝,可能应该使用这样的东西,
god: rvmsudo god -c /path_to_yourgod_file.god
但为什么你需要两个不同的监控系统,而你可以使用它们来完成工作?