Search code examples
erbmonit

How to erb'up a monitrc configuration file


Below is my delayed_job monitrc file, i wanted to use it as an erb template so that i can dynamically set the RAILS_ENV variable. Does anyone know how to do it?

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"

Solution

  • How about

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

    with these variables set accordingly?