2

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"
Pratik Khadloya
  • 12,509
  • 11
  • 81
  • 106

1 Answers1

1

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?

awendt
  • 13,195
  • 5
  • 48
  • 66
  • Thats correct. This is how the erb file will look. But i want to know how to run this file from the command line or what kind of a setup we need to do for erb'ed monitrc's.+1 – Pratik Khadloya Jun 29 '11 at 13:52