monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monit Can't start delayed_job


From: Asit Mishra
Subject: Re: Monit Can't start delayed_job
Date: Fri, 1 Oct 2010 13:19:34 -0700


Nevermind, this was actually a problem with the way delayed job was logging during initialization. Still don't know why can't get failure output from monit, but at least this issue is resolved.

Thanks

On Fri, Oct 1, 2010 at 12:43 PM, Asit Mishra <address@hidden> wrote:
Martin,

I changed my delayed_job.monitrc file, but I don't see any output in the /tmp/delay_job.out. I did reinitialize the monit gem with a monit reload command.

check process delayed_job with pidfile /var/www/app/shared/pids/delayed_job.pid
  start program = "/bin/bash -c '/usr/bin/env RAILS_ENV=production PATH=$PATH:/usr/local/bin /var/www/app/current/script/delayed_job start > /tmp/delay_job.out 2>>&1'"

                as uid deploy and gid www-data
  stop program =  "/usr/bin/env RAILS_ENV=production PATH=$PATH:/usr/local/bin /var/www/app/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

Thanks for your help. Any thoughts?


On Fri, Oct 1, 2010 at 10:55 AM, Martin Pala <address@hidden> wrote:
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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]