如何erb'up一个monitrc配置文件

时间:2011-06-09 16:58:31

标签: erb monit

下面是我的delayed_job monitrc文件,我想将它用作erb模板,以便我可以动态设置RAILS_ENV变量。有谁知道怎么做?

set daemon  120

check process delayed_job with pidfile /home/rails/public_html/myapp/shared/pids/delayed_job.pid
  start program = "/usr/bin/env RAILS_ENV=production /home/rails/public_html/myapp/current/script/delayed_job start"
  stop program = "/usr/bin/env RAILS_ENV=production /home/rails/public_html/myapp/current/script/delayed_job stop"

1 个答案:

答案 0 :(得分:1)

怎么样

set daemon <%= interval %>
check process <%= process_name %> with pidfile <%= pidfile %>
  start program = "<%= start_program %>"
  stop program = "<%= stop_program %>"

相应地设置这些变量吗?