You can log start/stop program output like this:
start program = "/bin/bash -c '/usr/bin/env RAILS_ENV=production PATH=$PATH:/usr/local/bin /var/www/app_name/current/script/delayed_job start > /tmp/delay_job.out 2>>&1'"
Regards,
Martin
On Fri, Oct 1, 2010 at 9:23 AM, Asit Mishra
<address@hidden> wrote:
I have the following monitrc script for a ruby background job delayed_job
check process delayed_job with pidfile /var/www/app_name/shared/pids/delayed_job.pid
start program = "/usr/bin/env RAILS_ENV=production PATH=$PATH:/usr/local/bin /var/www/app_name/current/script/delayed_job start"
as uid deploy and gid www-data
stop program = "/usr/bin/env RAILS_ENV=production PATH=$PATH:/usr/local/bin /var/www/app_name/current/script/delayed_job stop"
as uid deploy and gid www-data
if mem usage > 20% for 5 cycles then alert
if mem usage > 30% for 5 cycles then restart
If I run monit not as a daemon like monit -vIc /etc/monit/monitrc then it does somehow start the job.
but if it's running as a daemon, then it says "execution failed" and there is no indication why.
I know monit has issues with path variables..so I am including the path, am I missing something?
Thanks